unable to use my website

June 23, 2017 2.2k views
Apache Ubuntu

Ok so I have everything (I thought setup correctly) I have a droplet for my site. I also am using Putty to run everything (like Apache). I am using FileZilla for the obvious reasons. Now my issue is that when I start up the apache server it gives me this "Starting web server: apache2apache2: Could not reliably determine the server's fully qualified domain name, using for ServerName
httpd (pid 20412) already running"

So instead of the server running (my droplets IP) its running This may be a super simple fix and I am just overlooking something. Also if I go to my websites IP I get this "www.’s server DNS address could not be found."

4 Answers
hansen June 24, 2017
Accepted Answer

Your .htaccess should only be this:

RewriteEngine on
RewriteRule ^(\w+)$ index.php?page=$1 [L,NC,QSA]
RewriteRule ^(\w+)+\/$ index.php?page=$1 [L,NC,QSA]

And you don't have ServerName defined within your VirtualHost block. Don't you have a domain?

Your webserver works fine, you have some configuration that prefixes www. to the request.

  • Anytime I type in that IP it automatically puts it there

    • I'm aware, that's why I said you have some configuration that prefixes www. to the request.

      • this may sound like a really dumb question but how do I get rid of this

        • I don't know, it's your configuration. Most likely in .htaccess or your vhost.

          • RewriteEngine on
            RewriteRule ^(\w+)$ index.php?page=$1 [L,NC,QSA]
            RewriteRule ^(\w+)+\/$ index.php?page=$1 [L,NC,QSA]
            RewriteCond %{HTTPHOST} !^$
            RewriteCond %{HTTP
            HOST} !^www. [NC]
            RewriteCond %{HTTPS}s ^on(s)|
            RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

            order allow,deny
            deny from
            allow from all

            what needs to be changed?

          • Get rid of the "www." in the RewriteRule.

Hi @ghtv99

You web server is doing a failed redirect.

Can you post your VirtualHost configurations? Have a look in the directory:

And make sure that you don't have any .htaccess files in your web root, which might be doing the bad redirect.

  • Hi thanks for replying! Well it seems that I only have a "apache2" folder not a "apache"

    • Same same, but different - I don't have an active Apache setup, so didn't know.

      • I dont have any virtualhost configurations in there I only have a folder called 000-default

        • If there's no files in /etc/apache2/sites-enabled/ then the only place I can think of would be /etc/apache2/apache2.conf
          You can post the file to www.pastebin.com and put the link here.

          • Found it!

            <VirtualHost *:80>
            ServerAdmin webmaster@localhost

            DocumentRoot /var/www
            <Directory />
                Options FollowSymLinks
                AllowOverride None  
            <Directory /var/www/>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All       
                Order allow,deny
                allow from all
            ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
            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


Have another answer? Share your knowledge.