• I’ve set up a new WordPress site on a CentOS server running Apache. I’ve created a one-to-one NAT connection on our exterior facing firewall from the exterior IP address to the internal server, and the appropriate DNS entry at GoDaddy to point to our exterior address.

    I guess this is sort of a “generic” question – When setting up WordPress as I’ve described, do one *need* to create a virtual host entry (or is there an advantage to doing so?) in order to access the site, or is the NAT connection all I really need?

    This is my first WordPress site on one of my servers, so I welcome your feedback, suggestions, etc.

    Thank you,
    Ed

    • This topic was modified 4 years, 10 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    If you put the site in /var/www/html, then it’s the default virtual host and you should be OK. If you’ve put it elsewhere, then you should have a virtual host config for it that points to its proper document root.

    Thread Starter edflecko

    (@edflecko)

    Thank you!

    Since this web-server will, eventually, be serving more than one website, can you guide me on creating the necessary vhost entries? For example, should I create one file for all of the vhost entries, or is the CentOS, Apache default (/etc/httpd/conf/httpd.conf) where I should be creating the vhost entries?

    Does this look correct?

    <VirtualHost *:80>
      DocumentRoot /var/www/html/
      ServerName mynewwebsite.org
      ServerAlias www.mynewwebsite.org
      ErrorLog /var/log/httpd/mynewwebsite-error-log
      CustomLog /var/log/httpd/mynewwebsite-log common
    </VirtualHost>

    Ed

    Moderator Steven Stern (sterndata)

    (@sterndata)

    Volunteer Forum Moderator

    I create a vhost config file in /etc/httpd/conf.d for each virtual host, usually named example.com.conf, so I know what’s what. I use the same naming scheme in /etc/php-fpm.d for the PHP pool for each host.

    In the stuff you posted, there should be no https:// in the ServerAlias. (The forum software was being helpful and making a link where there was none. I edited your post with code tags to fix that.)

    These are not WordPress questions… check the CentOS mailing list or support forums to help config your server.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is Apache virtual host entry needed to access new website?’ is closed to new replies.