Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > ISPConfig 2 > Tips/Tricks/Mods

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Reply
 
Thread Tools Display Modes
  #1  
Old 13th August 2006, 08:14
datayoung datayoung is offline
Junior Member
 
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Exclamation Hi!I got cpanel redirect style working,I need your recheck for secure

After spend time for try to make redirect like cpanel
http://xxx.xxx.xxx/cpanel
http://xxx.xxx.xxx/webmail

here my best solution for now and for my little knowledge

First I want it work for all domain ,I don't want to copy each code to each vhosts
I decided to make it in /etc/apache2/apache2.conf

here my step/code
1.vi /etc/apache/apache2.conf

*add (before last line)

Alias /cpanel "/home/admispconfig/ispconfig/web/gocpanel/"
alias /webmail "/home/admispconfig/ispconfig/web/gowebmail/"

*above you can notice 2 points
1.Alias or alias is not matter it is work.
2.I redirect to /home/admispconfig/ispconfig/web/xxx
Why I did this? The reason is I need working on php,I can't direct outside because ispconfig took php out from normal apache state to allowed only owner want
then I using ispconfig space for run php in xxx

now go in here
cd /home/admispconfig/ispconfig/web/gocpanel
vi index.php
<?
$wh=$_SERVER["HTTP_HOST"];
echo "<meta http-equiv='refresh' content=0;url=https://www.$wh:81>";
?>
now go in
cd /home/admispconfig/ispconfig/web/gowebmail
vi index.php
<?
$wh=$_SERVER["HTTP_HOST"];
echo "<meta http-equiv='refresh' content=0;url=https://www.$wh:81/roundcubemail/index.php>";
?>

that all it have done which work perfect,and should be the answer who would like to use this redirect style,many cpanel users would be love it
*I didn't talk about http://webmail.xxx.xxx or http://cpanel.xxx.xxx or "co-domain"

I ask for you to test and let me know where will be the weak point of method
then another things I had posted somewhere for make more look like in home directory (make link of web by www,public_html for home page same as cpanel doing) ,you can find it in this forum

Thanks

Last edited by datayoung; 13th August 2006 at 08:17.
Reply With Quote
Sponsored Links
  #2  
Old 14th August 2006, 18:18
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

I've just moved this to the Tips/Tricks forum.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #3  
Old 15th August 2006, 00:38
adriaan adriaan is offline
Member
 
Join Date: Jul 2006
Location: Netherlands
Posts: 43
Thanks: 5
Thanked 0 Times in 0 Posts
Send a message via MSN to adriaan
Default

It's possible to redirect in Apache directly to a URL. -> Apache manual

You can use the php header function for redirecting. <?php header('Location: http://test:81'); ?> this is faster then META.
Reply With Quote
  #4  
Old 23rd August 2006, 21:20
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Default

On Fedora Core 3 I have found the file here:
/etc/httpd/conf/httpd.conf
Reply With Quote
  #5  
Old 24th August 2006, 11:10
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Default

I did like it is written above.
Unfortunately it doesn't work.

If I go to http://webmail.domain.tld it shows the standart ISPConfig welcome page.
If I go to http://www.domain.tld/webmail it shows a blank page.
If I go to http://webmail.domain.tld/webmail it shows the php file like a normal text and doesn't compile it, so you can see any code!!

I have other php files on the server wich work just fine.

Any ideas?

Thanks!

Last edited by torusturtle; 24th August 2006 at 11:22.
Reply With Quote
  #6  
Old 24th August 2006, 18:53
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Is PHP enabled for the webmail.domain.tld vhost?
If you need redirecting, also take a look here: http://www.stevenhargrove.com/redirect-web-pages/
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #7  
Old 24th August 2006, 19:48
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Default

Quote:
Originally Posted by falko
Is PHP enabled for the webmail.domain.tld vhost?
If you need redirecting, also take a look here: http://www.stevenhargrove.com/redirect-web-pages/
Yes, PHP Scripts is activated

Thanks for the link but unfortunately it does not cover httpd.conf redirects.
Reply With Quote
  #8  
Old 25th August 2006, 07:19
falko falko is offline
Super Moderator
 
Join Date: Apr 2005
Location: Lüneburg, Germany
Posts: 41,701
Thanks: 1,900
Thanked 2,745 Times in 2,578 Posts
Default

Quote:
Originally Posted by torusturtle
it does not cover httpd.conf redirects.
It does:

Code:
Redirect 301 /old/old.html http://www.you.com/new.html
or

Code:
RewriteEngine On
rewritecond %{http_host} ^yoursite.com
rewriteRule ^(.*) http://www.yoursite.com/$1 [R=301,L]
for example.
__________________
Falko
--
Download the ISPConfig 3 Manual! | Check out the ISPConfig 3 Billing Module!

FB: http://www.facebook.com/howtoforge

nginx-Webhosting: Timme Hosting | Follow me on:
Reply With Quote
  #9  
Old 25th August 2006, 09:11
torusturtle torusturtle is offline
Senior Member
 
Join Date: Apr 2006
Posts: 296
Thanks: 21
Thanked 24 Times in 16 Posts
Send a message via ICQ to torusturtle Send a message via AIM to torusturtle
Smile

You where right.
I did insert
Quote:
redirect 301 /webmail https://www.domain.tld:81/roundcubemail/
into etc/httpd/conf/httpd.conf and it worked!

Cool! Thanks.
Reply With Quote
  #10  
Old 25th August 2006, 11:01
datayoung datayoung is offline
Junior Member
 
Join Date: Jul 2006
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
 
Default Updated code fixed

Thanks adriaan,I didnt change code yet and I will

if your customers/user type URL with prefix www will got error
here fixed problem

* I don't think use redirect in apache will work for global domains VAR
* If you use redirect you need to specific domain name for each virtual server
Do you have function to get domain from URL in apache?
Do I missed somethings?
* my code get domain name from browser and redirect to that same name but diffirent port or https ,It work for any domain in ISPConfig/Vhost without add each by each name by name

-----------------

echo "<meta http-equiv='refresh' content=0;url=https://www.$wh:81>";
change to
echo "<meta http-equiv='refresh' content=0;url=https://$wh:81>";

content=0;url=https://www.$wh:81/roundcubemail/index.php>";
change to
content=0;url=https://$wh:81/roundcubemail/index.php>";


-----------------
<?
$wh=$_SERVER["HTTP_HOST"];
echo "<meta http-equiv='refresh' content=0;url=https://www.$wh:81>";
?>
now go in
cd /home/admispconfig/ispconfig/web/gowebmail
vi index.php
<?
$wh=$_SERVER["HTTP_HOST"];
echo "<meta http-equiv='refresh' content=0;url=https://www.$wh:81/roundcubemail/index.php>";
?>
Reply With Quote
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


All times are GMT +2. The time now is 02:11.


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