0

I am getting frustrated now as i have removed all default vhosts and made all necessary changes but Main DocumentRoot refuses to go

root@example:/etc/apache2# apache2ctl -S
VirtualHost configuration:
*:80                   dev.example.com (/etc/apache2/sites-enabled/dev.example.com.conf:1)
*:443                  dev.example.com (/etc/apache2/sites-enabled/dev.example.com.ssl.conf:2)
ServerRoot: "/etc/apache2"
Main DocumentRoot: "/var/www"
Main ErrorLog: "/var/log/apache2/error.log"
Mutex mpm-accept: using_defaults
Mutex watchdog-callback: using_defaults
Mutex rewrite-map: using_defaults
Mutex ssl-stapling: using_defaults
Mutex ssl-cache: using_defaults
Mutex default: dir="/var/lock/apache2" mechanism=fcntl
PidFile: "/var/run/apache2/apache2.pid"
Define: DUMP_VHOSTS
Define: DUMP_RUN_CFG
User: name="www-data" id=33
Group: name="www-data" id=33

i have no default anything

root@example:/etc/apache2# ls -lha sites-enabled/
total 8.0K
drwxr-xr-x 2 root root 4.0K May  5 15:12 .
drwxr-xr-x 9 root root 4.0K May  5 15:03 ..
lrwxrwxrwx 1 root root   48 May  5 15:01 dev.example.com.conf -> ../sites-available/dev.example.com.conf
lrwxrwxrwx 1 root root   52 May  5 15:12 dev.example.com.ssl.conf -> ../sites-available/dev.example.com.ssl.conf

and i declared what i want DocumentRoot should be in the vhosts

<VirtualHost *:80>
    ServerAdmin [email protected]
    ServerName dev.dev.example.com
    Redirect permanent / https://dev.dev.example.com/


    <Directory />
        Options +FollowSymLinks
        AllowOverride All
    </Directory>

    DocumentRoot /var/www/owncloud
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

and

<VirtualHost *:443>
#               ServerAdmin webmaster@localhost
                ServerName dev.dev.example.com
                DocumentRoot /var/www/owncloud

                # Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
                # error, crit, alert, emerg.
                # It is also possible to configure the loglevel for particular
                # modules, e.g.
                #LogLevel info ssl:warn


                <Directory />
                    Options +FollowSymLinks
                    AllowOverride All
                </Directory>
...
...
...
</VirtualHost>

Here is owncloud.conf

Alias / "/var/www/owncloud/"
<Directory "/var/www/owncloud">
  Options +FollowSymLinks
  AllowOverride All

  <IfModule mod_dav.c>
        Dav off
  </IfModule>

  SetEnv HOME /var/www/owncloud
  SetEnv HTTP_HOME /var/www/owncloud
</Directory>

<Directory "/var/www/owncloud/data/">
  # just in case if .htaccess gets disabled
    Require all denied
</Directory>

So what do i do next now, because the Main DocumentRoot won't go away

1 Answer 1

0

First we want to make sure you have a working website before we can really proceed. Here are some steps I would like you to follow so we can test that.

First go to the /var/www/ folder and rename owncloud to owncloud-test. Create a new folder called owncloud. open that folder and create a file called index.html Open that file and type in it "This is a test" and save it.

Now make sure that the permissions are set correctly on the www folder type the following in terminal:

sudo chown -R www-data:www-data /var/www

Once that is done type

sudo service apache2 restart

Then open a web browser and go to

http://localhost

That should bring up a white page that says "this is a test"

If it doesn't please let me know what errors the page gives you in the browser and check /var/log/apache2/error.log and see if there is errors listed in there.

If it works let me know and I will try to help get owncloud working at that point.

Communication stopped at this point so I will just consider that it worked and explain how to put the original owncloud back and make sure the owner is proper on the folder so that hopefully owncloud will work.

Go back to the /var/www folder .. delete the owncloud folder we just created. Rename the owncloud-test folder back to owncloud. Run sudo chown -R www-data:www-data /var/www again just to make sure the owner didn't get changed when you renamed or changed anything.

And now you should be good to go .. when you go to http://localhost it should launch with the owncloud login screen. You should be able to access it though any computer connected to your network by your computers local IP address such as... if your computers local address on your network is 192.168.0.20 then any other computer on your network could access owncloud by using http://192.168.0.20 If you want it accessible from the net you will have to open the proper ports in your router which I won't go into here

10
  • tried that not working still the thing is i don't mind editing the Main DocumentRoot directory just to make it /var/www/owncloud/ so where can i make that change?
    – uberrebu
    May 5, 2016 at 22:14
  • sorry .. im a bit confused ... check also to see if you have a file in the config-enabled that says owncloud.conf... it too may be changing settings on the location .. but as for document root .. I'm assuming you want it to open directly to owncloud when you enter the website and not https:/website.com/owncloud like it is normally set to do am I right?
    – John Orion
    May 5, 2016 at 22:22
  • I would also like to know if you already have the owncloud installed and the folder is located at /var/www/owncloud .. if so .. do this .. rename that folder to owncloud-test .. then create a new folder called owncloud... in that folder put in a file called index.html and inside of the file just type "this is a test" then go to http://localhost and see if you get a page that says this is a test. just to see if the site itself is working.
    – John Orion
    May 5, 2016 at 22:25
  • I just posted the content of owncloud.conf file..also to understand what am saying here, i do NOT want to see Main DocumentRoot there set to that directory, i want it to show the document root i want, that is the main thing i want, anything after that i can take care of
    – uberrebu
    May 5, 2016 at 22:30
  • ok then ... the added lines I added probably aren't needed because they are added by the owncloud.conf file .. I am going to wipe out my answer and change to the next thing that could be the problem and will help us at least see if we can get the page to actually work so we know we have a working server before we try to get owncloud itself to work
    – John Orion
    May 5, 2016 at 22:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .