buy
How to run domain as IP

Overview

This guide will show you how you can run your site as a IP in webuzo.

NOTE:
This is possible for one user per domain only.

Procedure

For Apache Webserver:

You can write custom.conf and then upload it in /usr/local/apps/apache2/etc/conf.d/ directory.

# Replcae IP with your servers IP. 
	#For example : 192.198.129.120
	
# Replace USERNAME with the webuzo user you want to serve directory of.

# Replace PHP_VERSION with the Installed and running php version of Webuzo.
	#For example : php81 or php73 or php74 and so on.

<VirtualHost IP:80>
	ServerName IP
	DocumentRoot /home/USERNAME/public_html
	
	<IfModule security2_module>
		SecRuleEngine On
	</IfModule>
	<IfModule suexec_module>
		<IfModule !mod_ruid2.c>
			SuexecUserGroup USERNAME USERNAME
		</IfModule>
	</IfModule>
	<IfModule ruid2_module>
		RMode config
		RUidGid USERNAME USERNAME
	</IfModule>
	
	<FilesMatch \.(php|phtml)$>
		<If "-f %{REQUEST_FILENAME}">
			SetHandler "proxy:unix:/usr/local/apps/PHP_VERSION/var/fpm-USERNAME.sock|fcgi://localhost"	
		</If>
	</FilesMatch>
	
	ErrorLog /usr/local/apps/apache2/logs/IP.err
	CustomLog /usr/local/apps/apache2/logs/IP.log combined
	
</VirtualHost>

For Nginx Webserver:

You can write custom.conf and then upload it in /usr/local/apps/nginx/etc/conf.d/ directory.

# Replcae IP with your servers IP. 
	#For example : 192.198.129.120
	
# Replace USERNAME with the webuzo user you want to serve directory of.

# Replace PHP_VERSION with the Installed and running php version of Webuzo.
	#For example : php81 or php73 or php74 and so on.

server {
	listen		IP:80;
	server_name	IP;
	
	# The Document Root
	root		/home/USERNAME/public_html;
	set $fpmsocket /usr/local/apps/PHP_VERSION/var/fpm-USERNAME.sock;
		
	
		
	
	location ~ (\.php|phtml|shtml|/)$ {
		try_files  $uri $uri/index.php $uri/index.php8 $uri/index.php7 $uri/index.php5 $uri/index.perl $uri/index.pl $uri/index.plx $uri/index.ppl $uri/index.cgi $uri/index.jsp $uri/index.jp $uri/index.phtml $uri/index.shtml $uri/index.xhtml $uri/index.html $uri/index.htm $uri/index.js;
		fastcgi_pass unix:$fpmsocket;
		fastcgi_param	SCRIPT_FILENAME $document_root$fastcgi_script_name;
		fastcgi_param	SCRIPT_NAME	  	$fastcgi_script_name;
		include			fastcgi_params;			
			
	}
	error_log	/usr/local/apps/nginx/var/log/IP.err;
	access_log	/usr/local/apps/nginx/var/log/IP.log main;
	
	
	
	
	#webmail access from /webmail
	location ^~ /webmail {
		proxy_set_header Host $host;
		proxy_set_header Connection keep-alive;
		proxy_set_header X-Original-URI $request_uri;
		rewrite ^/webmail$ /webmail/ permanent;
		proxy_pass http://127.0.0.1:2002/mail/;
	}

}
    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list