How do I set up a virtualhost with wordpress on lamp?

0

Running Apache 2.4.6, PHP 5.5.8 on Ubuntu 12.04

Here's (in addition to default) my papertower config in sites-available: http://pastebin.com/rb8BPKh6

When I restart, I get this message: http://pastebin.com/mrTp9ie7

I'm coming from Apache on Windows and trying to set up the same workflow I had there. Basically, if I placed a folder in /www/papertower/ it would become accessible via directoryname.papertower.dev after adding the host. Worked great!

I'm having a strange issue getting it going again. Oddly, when I didn't have the wordpress config set up properly and went to site.papertower.dev, it would give me the "failed to connect to database" message. This made me happy, as it meant it was pointing at the right folder. Once I fixed the database config file, however, and go to site.papertower.dev, it gives me an "Oops! Google Chrome could not find www.site.papertower.dev".

I double-checked that all the appropriate mods were enabled (especially rewrite), but that hasn't made a difference.

I've been at this for hours.. Any help is greatly appreciated!

Edit: I've whittled this down to an issue where www is automatically being added to the front of the address. This then confuses the server and it looks for the site in /www/papertower/www. I've hunted around, and I cannot figure out how to get around this. It seems like a possible combination of a RewriteRule and VirtualDocumentRoot, but I just can't seem to figure it out.

Jason

Posted 2014-02-10T02:19:25.527

Reputation: 1

Answers

1

Delete the entry NameVirtualHost *:80 from your configuration file, since it already given inside ports.conf file. This is the reason for warning NameVirtualHost *:80 has no VirtualHosts.

or

This could be because of multiple entry of NameVirtualHost *:80 in ports.conf file inside /etc/apache2

See the below link, whether it will help you.

https://serverfault.com/questions/1405/apache-2-startup-warning-namevirtualhost-80-has-no-virtualhosts

Uvais Ibrahim

Posted 2014-02-10T02:19:25.527

Reputation: 345

I appreciated suggestion, but I checked this and it was between two configs in sites-available. I removed one and the error went away. Nevertheless, the problem persists and I've added more information above in "Edit". Thanks! – Jason – 2014-02-11T15:14:01.840