0

I've got a Drupal setup locally. When I access the homepage using my IP everything works. When I try any "re-written" url (such as 10.0.150.4/user) I get a not found.

When I replace my IP with an alias (and put that in my hosts) all urls work.

Here's my 000-default:

 <VirtualHost *:80>
        ServerAdmin webmaster@localhost
        DocumentRoot /home/g/www/paddle
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /home/g/www/paddle>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride None
                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>

3 Answers 3

0

I had to disable the 000-default site apparently.

3
  • 1
    This doesn't answer the question, and you haven't realy learned anything... I think your problem is that you thought you had a virtual host, but didn't. Your 000-default file doesn't contain a ServerName directive for example. So everything was probably served from the main context. What is the output of apache2ctl -S? Apr 6, 2013 at 6:58
  • but I actually got what I wanted: locally I can still use a serveralias to access my website, and externally people from the LAN can use my IP. Apr 6, 2013 at 13:47
  • @KristvanBesien: A <VirtualHost> need not contain a ServerName directive. In the absence of one, it will use the top-level ServerName (typically dynamically determined). Additionally, any configured and applicable (based on its IP/port tuple(s)) VHost will always "win" versus the main context.
    – BMDan
    Apr 23, 2013 at 19:19
0

I think you're running Drupal from a subdirectory of your website (ie, http://127.0.0.1/ is not a Drupal site, but http://127.0.0.1/asdf is the "root" of the Drupal site). If that's the case you need to open the .htaccess file, you'll find a line that starts RewriteBase, which needs to know what the "root" path to Drupal should be.

0

The reason this didn't work is that you are setting AllowOverride none in your 000-default VHost. This means that the clean URL feature in Drupal won't work, since it's reliant on a .htaccess file. Simply change that line to AllowOverride all and everything will work like a champ.

You must log in to answer this question.

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