Home > Mobile >  Apache configuration file and ports
Apache configuration file and ports

Time:12-17

I have a server, where I have a WHM panel with 4 accounts, each account with its domain. Sites Two accounts will run. Where: Account1 will run site1 on port 3000 Account2 will run site2 on port 3004 I need to know how to make my apache server redirect as routes to sites, where requests on port 3000 go to site1, and requests from port 3004 to site2. How do I do that?

CodePudding user response:

Virtual hosts solves this issue, create a virtual host for each port/host. Example:

<VirtualHost *:3000> # Or any other port
    DocumentRoot X:/path/to/site/1 # Remove X: in linux

    <Directory X:/path/to/site/1> # Remove X: in linux
        Option -Indexes # Disable directory indexing
        Allow from all 
        AllowOverride all # Allow all .htaccess
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
  • Related