Apache configuration file and ports

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?

Upvotes: 1

Views: 987

Answers (1)

Ahmed Shaqanbi
Ahmed Shaqanbi

Reputation: 783

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>

Upvotes: 1

Related Questions