0

I've been fighting this for many hours now, and I'm very frustrated. Apache just doesn't make sense to me; I'd greatly appreciate any advice. Please read through what I've written, as I've read through dozens of posts and manuals on the subject, and really need specific advice.

I'm trying to accomplish two goals: First, get "Pretty Links" to work on my local Wordpress instance; second, to set up a local domain for the site.

I have a fresh install of Apache 2.4.6 running, and I'll I've done is enable the rewrite and vhost_alias mods.

For the first goal, I understand I need to have AllowOverride set to All. This, I gather, allows .htaccess files within the subsequent directories to alter the apache config. To try one thing at a time, I'm accessing the site from localhost/var/www/dhae/Wordpress (foregoing the domain). I tried altering the 000-default.conf to oblige this: http://pastebin.com/PwMGF9F2 -- all I added was the section. This didn't work, and neither did changing the AllowOverride to All in the apache2.conf.

I wondered if perhaps I needed something more specific to the directory, so I tried using my second goal to accomplish this. I wrote the dhae.conf: http://pastebin.com/trwWVFLW

I've also added the following line to my HOSTS file: 127.0.0.1 dhae.dev

This hasn't worked either. I've tried virtual host config stuff as much as I could find, and I'm just not having any luck. I'm really at a loss, and I need this to work (especially my first goal), so I can continue my normal work.

Lastly, for the domain, I've checked and NameVirtualHost only exists in the dhae.conf file. It's not anywhere else. I'm familiar with that issue, and it's not happening here.

  • What is the distribution you're using to host the site? For your first attempt, DocumentRoot is set to /var/www, so you should be accessing your site through localhost/dhae/Wordpress. For your second attempt, it depends on the distrib how to enable this virtual host. Just note that as stated on httpd.apache.org/docs/2.4/upgrading.html, Order allow, deny and Allow from all have been replaced in apache 2.4 by Require all granted – user2313067 Feb 25 '14 at 21:18
  • Thanks! For the first, I am accessing it via localhost/dhae/wordpress, but I'm still getting a "Not Found" page when I follow any of the permalinks, suggesting the .htaccess isn't working. Concerning the second, I swapped what you pointed out (thanks!), but when I go to dhae.dev it simply takes me to /var/www instead of /var/www/dhae/wordpress. – Jason Feb 26 '14 at 15:47
  • What do you have in Apache's logs? Where they are depends on the distribution. – user2313067 Feb 26 '14 at 19:25
0

There was actually nothing wrong with my configuration. The problem was how I was restarting Apache. Apparently when 'service apache2 restart' is used, it may not re-cache the configuration files. Using 'etc/init.d/apache2 restart', on the other hand, will do this. As soon as I restarted it properly, everything worked.

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.