pawanthegunner
Member
Posted 1 year ago #
i installed my wordpress on my ubuntu 11.10 running the lamp-server. i created a virtual host for my site by editing the hosts file and apache config file so that my installion directory is different from /var/www.
i put up wordpress and everything seemed good, the dashboard and teh home page all came up flawlessly.
but when i create a new post or a page and try to navigate to it through its permalink, the browser throws this 404 error:
Not Found
The requested URL /new-post was not found on this server.
Apache/2.2.20 (Ubuntu) Server at websites Port 80
although the posts and page show up in the home page, but i can not open the individual posts or pages. whats going wrong?
for the apache confif, i followed this tutorial:
http://tuxtweaks.com/2009/07/how-to-configure-apache-linux/
You are probably not hitting the right VirtualHost.
How are you accessing the URL? Via http://localhost/?
pawanthegunner
Member
Posted 1 year ago #
i think i know the problem. its with the permalink structure. the default structure(/?p=123) works perfectly well. but others dont. the server fails to recognise these as valid ulrs. any solution?
Activate mod_rewrite and in your <VirtualHost> configuration put in these lines AllowOverride All. That should take care of the permalinks.
<Directory />
AllowOverride All
</Directory>
pawanthegunner
Member
Posted 1 year ago #
i think AllowOverride All i had already done. I guess this is what you are talking about: (the changes i had made are in bold)
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName site1
DocumentRoot /home/yourID/webdev/site1/
<Directory />
Options FollowSymLinks
AllowOverride None
</Directory>
<Directory /home/yourID/webdev/site1/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
I had already done it. Still doesnt work??
Is there a default site in your /etc/apache/sites-enabled directory? If there is, you may be hitting that instead of what you setup.
pawanthegunner
Member
Posted 1 year ago #
yup, thats right. there is a default site. so how do i redirect the server to the virtual host instead of the default site. i dont think deleting the default site is a good idea.
Are you using the default host? If not, it's just a symlink to ../sites-available/default.
You can delete the default symlink in sites-enabled and restart Apache.
If that works, cool. If not then re-create the symlink via a2ensite default.