0

I've installed www/wordpress port, configured wp-config.php and set up Apache config accordingly. The site is running OK.

Now, what should I do if I want another site to run Wordpress? I can't set /usr/local/www/wordpress as root dir for another virtual host, because it would pick up config of the first one and this would be, basically, the same site.

arrowd
  • 319
  • 1
  • 8

1 Answers1

0

You install it into a different folder and create an apache virtual host.

To install wordpress:

  • download it from the wordpress website
  • create a folder for a second wordpress installation, for example /usr/local/www/wordpress2
  • extract the contents of the downloaded file into that directory
  • change the owner of that directory to the webserver user with chown -R
  • create a new database for wordpress, this depends on what DB server you are using
  • change the apache configuration like so:

    # This first-listed virtual host is also the default for *:80 ServerName www.example.com ServerAlias example.com DocumentRoot "/usr/local/www/wordpress"

    ServerName other.example.com DocumentRoot "/usr/local/www/wordpress2"

Clients send the hostname in the HTTP GET, so the webserver can direct them to different websites based on that option.

For more information see the Apache Documentation: https://httpd.apache.org/docs/2.4/vhosts/name-based.html

Finally, run the setup script from your browser.

mzhaase
  • 3,798
  • 2
  • 20
  • 32