Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'm having trouble setting up Apache Server. I haven't turned anything off from the default install and I'm trying to enable the functionality for "Virtual Hosts." I would like Apache Server, which is hosted on EC2 (12.04 Server), to serve my site when people visit. My DNS provider is godaddy and I've forwarded my site from godaddy to my EC2 address. Problem is that no matter what I do, the default "It works!" page is always served. I can't figure it out. This is the top of my ports.conf file:

NameVirtualHost *:80
Listen 80

<IfModule mod_ssl.c>
    # If you add NameVirtualHost *:443 here, you will also have to change
    # the VirtualHost statement in /etc/apache2/sites-available/default-ssl
    # to <VirtualHost *:443>
    # Server Name Indication for SSL named virtual hosts is currently not
    # supported by MSIE on Windows XP.
    Listen 443
</IfModule>

<IfModule mod_gnutls.c>
    Listen 443
</IfModule>

My site is specified in sites-available file and there is a symbolic link visible to my site's directory in sites-enabled.

This is in the sites-available file for my site:

<VirtualHost *:80>
        ServerAdmin [email protected]

        ServerName somesite.com
        ServerAlias *.somesite.com

        DocumentRoot /var/www/somesite
        <Directory />
                Options FollowSymLinks
                AllowOverride All
        </Directory>
        <Directory /var/www/somesite>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

Any suggestions? Any further information needed? I've spend HOURS on this and have gotten no where. I seem to be doing everything the tutorials say to do. I have NOT disabled the default but have read that it's good to keep that up? Thanks.

share|improve this question

1 Answer 1

Man. I feel dumb about how long this took me to fix. Clearly I know nothing about administration...

Problem was that I set up my forwarding through GoDaddy to my server, but that's it. I expected my server to know it was coming from mysite.com somehow, but I wasn't passing it in the request. The request was just /. The answer was to change my forwarding from:

234.56.78.912:80 (where the first part of that ip I just made up...)

to

234.56.78.912:80/mySite/home.html

Now when it hits the server the request is mySite/home.html and it is recognized. Thank you trial and error!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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