LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   Regarding squirrel mail web page redirection. (https://www.linuxquestions.org/questions/linux-server-73/regarding-squirrel-mail-web-page-redirection-870664/)

ghpradeep 03-24-2011 03:17 AM

Regarding squirrel mail web page redirection.
 
HI,

I have configured qmail on rhel5 server with squirrel webclient. I am currently access squirrel mail using http://servername.domainname.com/webmail/src/login.php. I want to redirect this page to http://webmail.domainname.com


Please help me on this.

bathory 03-25-2011 04:04 AM

Hi,

You need to create a virtual host in your web server, name it webmail.domainname.com and use the path to squirellmail as its docroot.

Regards

ghpradeep 03-28-2011 03:37 AM

Hi,
I have created new virtual host as per ur instructions. can i access using http://webmail.mydomain.com/webmail. i want to access directly like when i enter webmail.mydomian.com in explore it should open webclient page.

i want to redirect http://servername.domainname.com/webmail/src/login.php to http://webmail.mydomain.com site.

bathory 03-28-2011 03:52 AM

Hi,

I've told you to use the path to squirrelmail as the DocumentRoot of the vhost. For example is the path to squirrelmail is /var/www/html/squirrelmail and assuming you run apache web server, you need something like:
Code:

<VirtualHost *:80>
ServerName webmail.mydomain.com
DocumentRoot /var/www/html/squirrelmail
...
</VirtualHost>

Regards

ghpradeep 03-28-2011 04:42 AM

Hi,

My domain name is rtscmail.in. I have configured httpd.conf as per below:

<VirtualHost *:80 >
ServerName webmail.rtscmail.in
ServerAdmin postmaster@rtscmail.in
DocumentRoot /var/www/html/webmail
</VirtualHost>

when i tried to access webclient using http://webmail.rtscmail.in it shows me default http testpage. but when i tried to access using http://webmail.rtscmail.in/webmail. its work.

i dont want to type /webmail at end of the address to access web base client.

Hope u understand my problem.

Thanks in Advance...

bathory 03-28-2011 05:18 AM

I've understood your problem, but you don't give much details.
How did you install squirrelmail? If you used your package manager, then it's installed in /usr/share/squirrelmail and there should be an Alias /webmail
If that's the case, use /usr/share/squirrelmail as the DocumentRoot of webmail.rtscmail.in and comment out the Alias
Or post here httpd.conf so we can have a better look

Regards

ghpradeep 03-28-2011 05:35 AM

I have installed squirrel mail as per instruction mention in qmail site I have configured qmail as a email server. I have configured httpd.conf file as per instruction mention in qmailrocks.org site on page http://qmailrocks.org/webmail_rh_slack.htm.

<VirtualHost 192.168.2.147:80>
ServerName rtsc.rtscmail.in
ServerName webmail.rtscmail.in
ServerAlias mail.*
ServerAdmin postmaster@rtscmail.in
DocumentRoot /var/www/html/
</VirtualHost>


<VirtualHost *:80 >
ServerName webmail.rtscmail.in
ServerAdmin postmaster@rtscmail.in
DocumentRoot /var/www/html/webmail
</VirtualHost>

bathory 03-28-2011 05:51 AM

Your configuration is wrong. You need only one (1) vhost named webmail.rtscmail.in, or the first one will take precedence.
Also check the NameVirtualHost directive (e.g. NameVirtualHost 192.168.2.147:80) and make sure it matches the notation used by the VirtualHost tag (e.g. <VirtualHost 192.168.2.147:80>).
So try the following instead:
Code:

<VirtualHost 192.168.2.147:80>
ServerName rtsc.rtscmail.in
ServerAdmin postmaster@rtscmail.in
DocumentRoot /var/www/html/
</VirtualHost>
<VirtualHost 192.168.2.147:80>
ServerName webmail.rtscmail.in
ServerAdmin postmaster@rtscmail.in
DocumentRoot /var/www/html/webmail
</VirtualHost>


ghpradeep 03-28-2011 06:02 AM

Hi,

I tried given configuration it only work when i used http://webmail.rtscmail.in/webmail. Its not working for http://webmail.rtscmail.in

when i used http://webmail.rtscmail.in its display test page. but when i used http://webmail.rtscmail.in/webmail then only i get squirrel web mail login screen.

ghpradeep 03-28-2011 06:11 AM

HI,

Now its working. I can access site using http://webmail.rtscmail.in.

any idea to to secure it using https://

Thanks for help....

bathory 03-28-2011 06:29 AM

Quote:

Now its working. I can access site using http://webmail.rtscmail.in.
You forgot to restart apache?

Anyways you need to create an https vhost using mod_ssl. You can take a look here for detailis
When you are sure that it's working and you can access https://webmail.rtscmail.in, you can create a .htaccess in /var/www/html/webmail containing:
Code:

RewriteEngine On

RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

to force users use https

Regards

ghpradeep 03-29-2011 06:18 AM

Hi,

I am getting below error.
Not Found

The requested URL / was not found on this server.

after adding Rewrite engine in htaccess file. any thing need to change the port 80 to 443 in httpd.conf file.

bathory 03-29-2011 06:35 AM

Why don't you post your ssl configuration?
From the error, I can only guess that you have to create an ssl vhost (webmail.rtscmail.in) that uses the same docroot and other settings as the non-ssl one.

ghpradeep 03-29-2011 06:52 AM

can u pleas post me ssl.configuration i have not configure ssl on my server. Hope u have all details:

docroot /var/www/html/webmail
server name webmail.rtscmail.in

bathory 03-29-2011 07:17 AM

I gave you a link to help you setup apache with ssl. Everything you need is written there.
Follow it and post here any errors you may get along with your configuration.


All times are GMT -5. The time now is 08:51 PM.