• The vhosts package seems unstable, sometimes it works. Right now it wont start.
    php: /status_services.php: The command '/usr/local/etc/rc.d/vhosts-http.sh stop' returned exit code '1', the output was 'usage: kill [-s signal_name] pid … kill -l [exit_status] kill -signal_name pid … kill -signal_number pid ...'

    Any one seen this?


  • Looks like it is actually running but not according to the status page, I presumed this issue was fixed as it has been showing as started in services up to now.

    What was causing me to think it wasn't running is that my dansguardian access denied page which is running on vhost seems to perform an infinite rediirect loop when I am explicitly connecting to  danguardian in non transparent mode, this does not happen in transparent mode.

    Another one for me to get to the bottom of, anyone else seen this?


  • pfsense 2.1

    I faced some troubles too.

    From the web gui it seems possible to add several virtual hosts (both http and https). It actually creates only one working http vhost while creates correctly several https hosts.

    You can check this in config.xml

    
     <installedpackages>...
    		 <service><name>vhosts-http</name>
    			<rcfile>vhosts-http.sh</rcfile>
    			<executable>vhosts-http</executable></service> 
    		 <service><name>vhosts-ssl-1</name>
    			<rcfile>vhosts-192.168.1.1-443-ssl.sh</rcfile>
    			<executable>vhosts-192.168.1.1-443-ssl</executable></service> 
    		 <service><name>vhosts-ssl-2</name>
    			<rcfile>vhosts-192.168.1.1-8800-ssl.sh</rcfile>
    			<executable>vhosts-192.168.1.1-8800-ssl</executable></service> 
    
    		 <vhosts><config><host>pfsense.localdomain</host>
    				<ipaddress>192.168.1.1</ipaddress>
    				<port>443</port>
    				<directory>cp</directory>
    				<certificate>KKK</certificate>
    				<privatekey>YYY</privatekey>
    				<enabled>true</enabled></config> 
    			 <config><host>vhost01.localdomain</host>
    				<ipaddress>192.168.1.1</ipaddress>
    				<port>8800</port>
    				<directory>vhost01</directory>
    				<certificate>ZZZ</certificate>
    				<privatekey>XXX</privatekey>
    				<enabled>true</enabled></config> 
    			 <config><host>pfsense.localdomain</host>
    				<ipaddress>192.168.1.1</ipaddress>
    				<port>9999</port>
    				<directory>vhost01</directory>
    				 <certificate><privatekey><enabled>true</enabled></privatekey></certificate></config> 
    			 <config><host>pfsense.localdomain</host>
    				<ipaddress>192.168.1.1</ipaddress>
    				<port>80</port>
    				<directory>vhost00</directory>
    				 <certificate><privatekey><enabled>true</enabled></privatekey></certificate></config></vhosts> 
    ...</installedpackages> 
    
    

    'get_service_status' function in /etc/inc/service-utils.inc contains

    
    		case "vhosts-http":
    			$running = is_pid_running("{$g['varrun_path']}/vhosts-http.pid");
    			break;
    ...
    		default:
    			$running = is_service_running($service['name']);
    
    

    get_service_status will call is_pid_running('/var/run/vhosts-http.pid') for http vhost while calls is_service_running(vhosts-ssl-[1..N]) for https one (taken from <executable>tag).
    in turn is_service_running will call is_process_running defined in /etc/inc/util.inc that does the pgrep:

    
    exec("/bin/pgrep -anx {$process}", $output, $retval);
    
    

    pgrep with x parameter will "require an exact match of the process name" and the process name is lighttpd, not vhosts-ssl-n

    so..

    I changed /bin/pgrep -anx to /bin/pgrep -anf which will look at parameters also.

    I'm not sure if taking out that 'x' will lead to troubles but it works for now.</executable>


  • In my case I got a problem with the deletion of the config file:
    2013-12-02 10:23:52: (configfile.c.989) opening configfile  /var/etc/vhosts-http.conf failed: No such file or directory

    After a reinstall of the package the file it's regenerated.

    The pfsense box had a energy outage before the problem, but I don't know why the file it's deleted. It could be corrupted and the fsck deletes it, but I got this problem two times.


  • I got the same problem today. The config file was deleted/fixed by the fsck.

    There it's no need to reinstall package. You only need to enter in the vhost package configuration within the pfSense webConfigurator, enter in one of the virtual hosts and click save. The webconfigurator recreates the config file and you only need to start the process.


  • Every-time i reboot Pfsense the vhost configuration file is deleted, and must go to vhost service page and save the previous config to recreate the config file.

    Pfsense 2.1.3 i386