0

I am trying to configure apache and I created a directory in /srv/www because I want my default root folder there instead of /var/www. I opened the config file in /apache2/sites-available (and properly linked the sites-enabled to this config file) and this is what it looks like:

<VirtualHost *:80>
        # The ServerName directive sets the request scheme, hostname and port that
        # the server uses to identify itself. This is used when creating
        # redirection URLs. In the context of virtual hosts, the ServerName
        # specifies what hostname must appear in the request's Host: header to
        # match this virtual host. For the default virtual host (this file) this
        # value is not decisive as it is used as a last resort host regardless.
        # However, you must set it for any further virtual host explicitly.

        serverAlias extracurricular.com
        ServerAdmin lleeoo66@extracurricular.com
        DocumentRoot /srv/www/extracurricular.com

        # 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

        Options FollowSymLinks
        AllowOverride None

        Options Indexes FollowSymLinks Mult

iViews

        AllowOverride None
        Order allow,deny
        allow from all

        ErrorLog ${APACHE_LOG_DIR}/error.log
        # Possible values are: debug, info, not ice, warn, error, crit, alert, emerg
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/extracurricular.com_access.log combined

</VirtualHost>

My ip to my vps is: http://192.99.246.96/

It is just bringing me to the /var/www folder and not /srv/www/extracurricular.com (my domain name). Why is this?

P.S. I have a simple index.html in my /extracurricular.com directory

-1
<VirtualHost *:80>
    ServerName  extracurricular.com
    #serverAlias www.extracurricular.com
    ServerAdmin lleeoo66@extracurricular.com
    DocumentRoot /srv/www/extracurricular.com

    <Directory "/srv/www/extracurricular.com">
            Options FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            Allow from all
            DirectoryIndex index.php index.html index.htm
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    # Possible values are: debug, info, not ice, warn, error, crit, alert, emerg
    LogLevel warn
    CustomLog ${APACHE_LOG_DIR}/extracurricular.com_access.log combined
</VirtualHost>
| improve this answer | |
  • 1
    @ Muru: That is actually an answer. Alexander: please state more clearly the changes you did by using text like "Add: ServerName extracurricular.comand remove serveralias etc... (keep in mind that you're answering a reputation 13 user and what is obvious to you and me is difficult enough to post a question here for the person that is installing his first server...) ;-) – Fabby Jan 17 '15 at 11:21
  • 1
    @Fabby I understand the changes that are made and why I have to make them. You are however right on the money, as this is my first server, and I am entirely new to this. – rip jerry Jan 18 '15 at 2:14
  • @ripjerry: could you edit the answer then and make it more clear for the next user who doesn't? (I've got my hands full with other stuff on the site) – Fabby Jan 18 '15 at 2:42
  • 1
    @Fabby Wow I didnt know I could edit the answers, thanks! – rip jerry Jan 18 '15 at 2:54
  • It'll get to someone (like me) who has to review your edits, so don't do anything crazy! :P ;-) – Fabby Jan 18 '15 at 3:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.