Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 3 > Installation/Configuration

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 29th April 2012, 02:18
fatbear fatbear is offline
Member
 
Join Date: Jul 2010
Location: Raleigh, NC US
Posts: 40
Thanks: 4
Thanked 8 Times in 4 Posts
Default Creating Websites that Use Non-Standard Ports

I want Apache to listen on non-standard ports. Instead of 80 and 443 for http and https, I want it to listen on 10080 and 10443. In the control panel, I went to:
System > Server IP addresses > [click on server name]
And, then I changed the HTTP Ports from 80,443 to 10080,10443.

When I create a new website "xyzzy.net" by doing:
Sites > Add new website > IPv4-Address > [the above IP address]
I find that the domain configuration file:
/etc/httpd/conf/sites-enabled/100-xyzzy.net.vhost
has in it:
<VirtualHost 11.22.33.44:80>
not the 10080 that I would have expected.

By the way, the reason I want this is because I'm running the Pound load balancer and reverse proxy because I'm also running Tomcat and other software on this server and it takes care of redirecting URLs on ports 80 and 443 to the appropriate backend application code. Note, this is also useful because in various corporate environments non-standard ports are blocked on web pages, so I need something like Pound to take care of the traffic redirection.

What did I do wrong? What do I need to do to get ISPConfig to use the ports that I've specified for that IP address? Is this a bug?
__________________
Steve Amerige, Fat Bear Incorporated
Server Leasing | Web Software Development | User Experience & Graphic Design
Managed Services, Website, Java, and Source-Code Hosting
Did my post help you? Click the Thanks button!
Reply With Quote
Sponsored Links
  #2  
Old 29th April 2012, 12:08
fatbear fatbear is offline
Member
 
Join Date: Jul 2010
Location: Raleigh, NC US
Posts: 40
Thanks: 4
Thanked 8 Times in 4 Posts
Default

Some checking reveals that the file:

/usr/local/ispconfig/server/plugins-enabled/apache2_plugin.inc.php has (lines 1014-1029):
Code:
//* Add vhost for ipv4 IP       
if(count($rewrite_rules) > 0){
    $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80, 'redirects' => $rewrite_rules);
} else {
    $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 0, 'port' => 80);
}

//* Add vhost for ipv4 IP with SSL
if($data['new']['ssl_domain'] != '' && $data['new']['ssl'] == 'y' && @is_file($crt_file) && @is_file($key_file) && (@filesize($crt_file)>0)  && (@filesize($key_file)>0)) {
    if(count($rewrite_rules) > 0){
        $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443', 'redirects' => $rewrite_rules);
    } else {
        $vhosts[] = array('ip_address' => $data['new']['ip_address'], 'ssl_enabled' => 1, 'port' => '443');
    }
    $app->log('Enable SSL for: '.$domain,LOGLEVEL_DEBUG);
}
Note that the port is hardcoded above (scroll to the right) to being set to 80 or 443:
'port' => '80'
'port' => '443'
I'll look at updating this code to use the values that are specified in the control panel and submit it to the codebase.
__________________
Steve Amerige, Fat Bear Incorporated
Server Leasing | Web Software Development | User Experience & Graphic Design
Managed Services, Website, Java, and Source-Code Hosting
Did my post help you? Click the Thanks button!
Reply With Quote
The Following 2 Users Say Thank You to fatbear For This Useful Post:
falko (30th April 2012), till (30th April 2012)
  #3  
Old 5th July 2012, 16:17
letic letic is offline
HowtoForge Supporter
 
Join Date: Jul 2006
Posts: 28
Thanks: 10
Thanked 3 Times in 3 Posts
Default

Hey fatbear,

I was trying to do the same today (Apache running on 81 with nginx proxy on port 80).and encountered the same issue.

The settings in Server -> IP addresses does update /etc/apache2/sites-available/ispconfig.conf with the correct NameVirtualHost (for those interested the code is in /usr/local/ispconfig/server/plugins-available/apache2_plugin.inc.php in
Code:
function server_ip($event_name,$data)
But the vhost file is not updated as it is hardcoded (as you shown). Did you have time to make a patch for this ? How do you decide which port has SSL enabled or not ?

Thanks in advance.
LeTic
Reply With Quote
  #4  
Old 5th July 2012, 17:42
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,687
Thanks: 819
Thanked 5,318 Times in 4,171 Posts
Default

There is no need to coady anything, you can change all tehse settings directly in the template. See e.g.:

http://www.howtoforge.com/forums/sho...31&postcount=9
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
  #5  
Old 5th July 2012, 18:05
letic letic is offline
HowtoForge Supporter
 
Join Date: Jul 2006
Posts: 28
Thanks: 10
Thanked 3 Times in 3 Posts
Default

Hey till,

I know you can change the template but what happens in a multi-server environment ? Do you change the template only on the slave that have the specific configuration ?

It would still be nice to be able to use the port defined in the settings.

LeTic
Reply With Quote
  #6  
Old 5th July 2012, 18:58
till till is online now
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 35,687
Thanks: 819
Thanked 5,318 Times in 4,171 Posts
 
Default

A template is used on the server where it is located. So if you have slaves with different configurations, then change the template only on that slaves where the different configuration shall be applied.
__________________
Till Brehm
--
Get ISPConfig support and the ISPConfig 3 manual from ispconfig.org.
Reply With Quote
The Following User Says Thank You to till For This Useful Post:
letic (25th July 2012)
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ISPCONFIG 3 - Issue creating websites after assigning an IP Address michael2010 Installation/Configuration 3 8th October 2010 08:07
Custom standard files and own shellscript execution after creating a new web Jürgen Developers' Forum 8 21st April 2009 16:50
sending e-mail using mail() function linuxuser1 HOWTO-Related Questions 38 21st April 2009 12:20
ISPConfig 2.2.14 released till General 48 19th July 2007 23:46
Problem with the apache (I can't start ist) M.Behrens Installation/Configuration 11 31st March 2006 10:48


All times are GMT +2. The time now is 10:34.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.