Running ownCloud and a website on the same server

Ask all your questions regarding OC 8.0 and 8.1 Please read the Support Forum Rules
Forum rules
The forums were migrated over to https://central.owncloud.org which is based on the forum software Discourse. The forums here is put into read-only mode starting from today.

More background information about this move and the reasoning behind it is available in this blogpost:

https://daniel.molkentin.net/2016/07/20 ... d-central/
ReekyMarko
Newbie
Posts: 3
Joined: Thu Jun 02, 2016 11:10 am
ownCloud version: 8.1.8
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.6.20
Contact:

Running ownCloud and a website on the same server

Postby ReekyMarko » Thu Jun 02, 2016 11:56 am

Hello there! I'm really new to ownCloud (just started yesterday) and have only basic Linux knowledge, so please be nice ;)

I'm running ownCloud on a Debian laptop with Apache, and the plan is to have my website running alongside it with like this:

www.mydomain.com points to my website
www.mydomain.com/cloud points to ownCloud

I have tried to edit multiple configuration files with tips I've found during hours of research with no success, I will paste them below. There might have been some more configurations regarding this that I don't remember, so ask if you need something else :)

OwnCloud is running just fine with HTTPS and SSL enabled but none of the configuration changes seem to reflect at all. Now, only mydomain.com points to ownCloud, trying mydomain.com/cloud results in: The requested URL /cloud was not found on this server. :x

Any help would be greatly appreciated, I want to get started using my own cloud :)

/etc/apache2/sites-enabled/000-default.conf

Code: Select all

NameVirtualHost *

<VirtualHost *:80>
        ServerName mydomain.com
        ServerAlias www.mydomain.com
        DocumentRoot /var/www/mydomain
        Customlog /var/www/logs/mydomain.log combined
        ErrorLog /var/www/logs/mydomain.log
</VirtualHost>

<VirtualHost *:80>
        ServerName mydomain.com/cloud
        ServerAlias www.mydomain.com/cloud
        DocumentRoot /var/www/owncloud
        CustomLog /var/www/logs/owncloud.log combined
        ErrorLog /var/www/logs/owncloud.log
</VirtualHost>


/etc/apache2/sites-enabled/default-ssl.conf

Code: Select all

<IfModule mod_ssl.c>
        <VirtualHost *:443>
                ServerAdmin webmaster@localhost

                DocumentRoot /var/www/owncloud
                ServerName mydomain.com/cloud
                ServerAlias www.mydomain.com/cloud

                ErrorLog ${APACHE_LOG_DIR}/error.log
                CustomLog ${APACHE_LOG_DIR}/access.log combined

                SSLEngine on

                SSLCertificateFile      /ssl-keys/mydomain.com.pem
                SSLCertificateKeyFile   /ssl-keys/mydomain.com.key

                <FilesMatch "\.(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                </FilesMatch>
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars
                </Directory>

                BrowserMatch "MSIE [2-6]" \
                                nokeepalive ssl-unclean-shutdown \
                                downgrade-1.0 force-response-1.0
                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

        </VirtualHost>
</IfModule>

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Running ownCloud and a website on the same server

Postby tflidd » Thu Jun 02, 2016 6:02 pm

Just put in your first virtual host:

Code: Select all

Redirect "/owncloud" "https://example.org/owncloud"


Your second vhost doesn't make sense, just delete it:

Code: Select all

<VirtualHost *:80>
        ServerName mydomain.com/cloud
        ServerAlias www.mydomain.com/cloud
        DocumentRoot /var/www/owncloud
        CustomLog /var/www/logs/owncloud.log combined
        ErrorLog /var/www/logs/owncloud.log
</VirtualHost>

ReekyMarko
Newbie
Posts: 3
Joined: Thu Jun 02, 2016 11:10 am
ownCloud version: 8.1.8
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.6.20
Contact:

Re: Running ownCloud and a website on the same server

Postby ReekyMarko » Thu Jun 02, 2016 8:01 pm

Just tried that, didn't work. Same results, mydomain.com still points to ownCloud instead of the website

Your second vhost doesn't make sense, just delete it:


Really? I followed this tutorial: https://www.youtube.com/watch?v=yUWtrYlM_9c and it explained to do just this to host two websites on a single machine.

Now I'm getting the feeling that ownCloud must somehow "hijack", if you will, the Apache configurations, because even if I add a simple configuration to host only the website (DocumentRoot /var/www/mywebsite) it will still only show just ownCloud on the root domain and local IP address :roll:

Do you, or anyone else, know of any configuration files in ownCloud that would enable me to use just http://www.example.com/cloud and NOT http://www.example.com?

tflidd
Forum Moderator
Posts: 7159
Joined: Sat Dec 07, 2013 7:27 pm
ownCloud version: 8.2.3
Webserver: Apache
Database: MySQL
OS: Linux

Re: Running ownCloud and a website on the same server

Postby tflidd » Thu Jun 02, 2016 11:16 pm

Normally, you should be able to open your website with http://www.example.org, your owncloud is only available via https://www.example.org. You have to be careful not to enable HTTP Strict Transport Security (HSTS) which owncloud motivates to use (meaning if the browser once accessed your domain it will continue connecting to your domain via https).
If you are owner of the domain, I would solve this by using different subdomains. www.example.org is typical for websites, your owncloud could reside in cloud.example.org or data.example.org.

ReekyMarko
Newbie
Posts: 3
Joined: Thu Jun 02, 2016 11:10 am
ownCloud version: 8.1.8
Webserver: Apache
Database: MySQL
OS: Linux
PHP version: 5.6.20
Contact:

Re: Running ownCloud and a website on the same server

Postby ReekyMarko » Wed Jul 06, 2016 1:23 am

A little bit of an update:

I got so frustrated with my whole web server project that I put it aside for a while. Couple of days ago I felt I should try again and started with a fresh installation of Debian and took everything slow and steady. Low and behold, I got the exact configuration I wanted up and running like a champ! :D

If anyone has similar problems, feel free to PM me, I'll be happy to help you, I feel your pain ;)

ReekyMarko out


  • Similar Topics
    Replies
    Views
    Last post

Return to “ownCloud Server 8.0 and 8.1”

Who is online

Users browsing this forum: No registered users and 2 guests