Setting roundcube into subdomain.

RickDeckard

Verified User
Joined
Mar 18, 2011
Messages
106
Hi, i've used these guide

http://help.directadmin.com/item.php?id=92

in my case i've added:

HTML:
<VirtualHost |IP|:|PORT_80| |MULTI_IP|>
  ServerName email.|DOMAIN|
  ServerAdmin |ADMIN|
  DocumentRoot /var/www/html/roundcube
  CustomLog /var/log/httpd/domains/|DOMAIN|.bytes bytes
  CustomLog /var/log/httpd/domains/|DOMAIN|.log combined
  ErrorLog /var/log/httpd/domains/|DOMAIN|.error.log
</VirtualHost>

look as example:
http://email.artigianisicilia.it/

All roundcube templates are not loaded correctly.

In the same domain I've created a sub domain "webmail" containing a file index.php with these string:
PHP:
<?php
header("Location: http://".$_SERVER['HTTP_HOST']."/roundcube/");
?>

http://webmail.artigianisicilia.it/

it work but it's a temporaney solution.
Any suggestion?
Thanks
 
Thanks for your reply, i'm using Nginx as proxy reverse.
I've tried also to edit the custom nginx_server.conf as explained but nginx doesn't restart.
 
This server is "live", meanwhile can we prepare correct nginx_server.conf conf?

original is
HTML:
|CUSTOM1|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
server
{
|CUSTOM|

	listen |IP|:|PORT_80|;
	|MULTI_IP|
  
       
	server_name |DOMAIN| www.|DOMAIN| |SERVER_ALIASES|;

	access_log /var/log/nginx/domains/|DOMAIN|.log;
	access_log /var/log/nginx/domains/|DOMAIN|.bytes bytes;
	error_log /var/log/nginx/domains/|DOMAIN|.error.log;
	

	root |DOCROOT|;
  
	index index.php index.html index.htm;
	
	|NGINX_PHP_CONF|

|*if HAVE_NGINX_PROXY="1"|
	location /
	{
|CUSTOM2|
|LOCATION_INSERT|
		# access_log off;
		proxy_buffering |PROXY_BUFFERING|;
		proxy_pass http://|IP|:|PORT_8080|;
		proxy_set_header X-Client-IP      $remote_addr;
		proxy_set_header X-Accel-Internal /nginx_static_files;
		proxy_set_header Host             $host;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
	}
	location /nginx_static_files/
	{
		# access_log  /var/log/nginx/access_log_proxy;
		alias       |DOCROOT|/;
		internal;
	}
|*else|
|NGINX_REDIRECTS|
|PROTECTED_DIRECTORIES|
|EXTRA_LOCATIONS|
|*endif|

|CUSTOM3|

	include /etc/nginx/webapps.conf;
	
|CUSTOM4|
}
 
Last edited:
Hey, what are you trying to do with that code? You can not use server_name more than once in per server section. And this is not what you can find on this page: http://help.directadmin.com/item.php?id=560 you need to follow the guide to get the things work. If this is something too complicated for you then please hire somebody from these forums (or other places) to make the things work for you.
 
something like:

HTML:
|CUSTOM1|
|?DOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?REALDOCROOT=`HOME`/domains/`DOMAIN`/public_html|
|?OPEN_BASEDIR_PATH=`HOME`/:/tmp:/var/tmp:/usr/local/lib/php/|
server
{
|CUSTOM|

	listen |IP|:|PORT_80|;
	|MULTI_IP|

	server_name |DOMAIN| www.|DOMAIN| |SERVER_ALIASES|;

	access_log /var/log/nginx/domains/|DOMAIN|.log;
	access_log /var/log/nginx/domains/|DOMAIN|.bytes bytes;
	error_log /var/log/nginx/domains/|DOMAIN|.error.log;
	

	root |DOCROOT|;
  
	index index.php index.html index.htm;
	
	|NGINX_PHP_CONF|

|*if HAVE_NGINX_PROXY="1"|
	location /
	{
|CUSTOM2|
|LOCATION_INSERT|
		# access_log off;
		proxy_buffering |PROXY_BUFFERING|;
		proxy_pass http://|IP|:|PORT_8080|;
		proxy_set_header X-Client-IP      $remote_addr;
		proxy_set_header X-Accel-Internal /nginx_static_files;
		proxy_set_header Host             $host;
		proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
	}
	location /nginx_static_files/
	{
		# access_log  /var/log/nginx/access_log_proxy;
		alias       |DOCROOT|/;
		internal;
	}
|*else|
|NGINX_REDIRECTS|
|PROTECTED_DIRECTORIES|
|EXTRA_LOCATIONS|
|*endif|

|CUSTOM3|

	include /etc/nginx/webapps.conf;
	
|CUSTOM4|
}

server
{
       listen |IP|:|PORT_80|;
       |MULTI_IP|

       server_name email.|DOMAIN|;

       root /var/www/html/roundcube;
       index index.php index.html index.htm;
       access_log /var/log/nginx/domains/|DOMAIN|.log;
       access_log /var/log/nginx/domains/|DOMAIN|.bytes bytes;
       error_log /var/log/nginx/domains/|DOMAIN|.error.log;

|*if HAVE_PHP1_FPM="1"|
       # use fastcgi for all php files
       location ~ \.php$
       {
               try_files $uri =404;
               fastcgi_split_path_info ^(.+\.php)(/.+)$;
               include /etc/nginx/fastcgi_params;
               fastcgi_index index.php;
               fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
               include /etc/nginx/nginx_limits.conf;

               if (-f $request_filename)
               {
                       fastcgi_pass unix:/usr/local/php|PHP1_RELEASE|/sockets/webapps.sock;
               }
       }
|*endif|

|*if HAVE_NGINX_PROXY="1"|
       location /
       {
               # access_log off;
               proxy_pass http://127.0.0.1:|PORT_8080|;
               proxy_set_header X-Client-IP      $remote_addr;
               proxy_set_header X-Accel-Internal /nginx_static_files;
               proxy_set_header Host             $host;
               proxy_set_header X-Forwarded-For  $proxy_add_x_forwarded_for;
       }
       location /nginx_static_files/
       {
               # access_log  /var/log/nginx/access_log_proxy;
               alias       /var/www/html/roundcube/;
               internal;
       }
|*endif|

       # deny access to apache .htaccess files
       location ~ /\.ht
       {
               deny all;
       }
}
 
I've done some test on a VPS with directadmin.
With Apache only as httpd server it work.
With Nginx only as httpd server it work (using the nginx_server.conf writed above).
With Apache + Nginx as reverse proxy i've again the same problem, roundcube templates are not loaded.
 
Try and change

Code:
proxy_pass http://127.0.0.1:|PORT_8080|;

to

Code:
proxy_pass http://<SERVER_IP>:|PORT_8080|;

in nginx template and re-write nginx configs.

p.s. replace <SERVER_IP> with a real server ip.
 
Back
Top