Orkan Köylü
Orkan Köylü

Reputation: 21

How can I create different ports on Apache VirtualHosts

I'm trying to create VirtualHost for a different port number with below code, but when I try to access that port number "domain: port" I receive "ERR_CONNECTION_REFUSED" error on browser.

Steps, what I do

  1. First editing http.conf, created for the related domain via Plesk
  2. I am writing these codes
  3. Restart Apache
    • Also I add that port number on httpd.conf. (Listen: port) but at this point I receive "Internal Server Error"

What do I use: Plesk 12, Apache/2.2.15 (Unix), Ngnix (Reserve proxy)

<VirtualHost IP:8324>
   DocumentRoot "/var/www/vhosts/httpdocs"
        ServerName "domain:8324"
        ServerAlias "www.domain.com"
        ServerAlias "ipv4.domain.com"
        UseCanonicalName Off

   <Directory /var/www/vhosts/httpdocs>
       DirectoryIndex index.php
       Options +Indexes +FollowSymLinks +MultiViews +Includes
       AllowOverride All
       Order allow,deny
       Allow from all
       Require all granted
   </Directory>
</VirtualHost>

What am I missing? Thank you

Upvotes: 2

Views: 1875

Answers (1)

Bogdan Stoica
Bogdan Stoica

Reputation: 4539

I think you can do that using a custom template for a specific vhost. You should check these two links. The might put you on the right track:

https://docs.plesk.com/en-US/12.5/advanced-administration-guide-linux/virtual-hosts-configuration/changing-virtual-hosts-settings-using-configuration-templates/example-changing-default-apache-ports.68800/

https://docs.plesk.com/en-US/onyx/advanced-administration-guide-linux/virtual-hosts-configuration/changing-virtual-hosts-settings-using-configuration-templates.68693/

Just so you know, any manual changes that you do in the httpd.conf file (from a ssh console for example, at the next plesk update or when you add/delete an account, they will be overwritten since Plesk is regenerating the httpd.conf file)

Upvotes: 1

Related Questions