[us...@httpd] Using Virtual hosts for all the websites in one instance of Apache
Hi, we have hundreds of websites and each website has multiple sub domains. All the sites are running under sun web server 7.0 For example, www.hosting.com is the main domain, it also has sub domain as www.hasting.com. www.hasting.com will be redirected back to www.hosting.com. sometimes, if the domain name is www.hostingforyou.com then it is redirected to a deep link of www.hosting.com like www.hosting.com/docs/newdomain.html or else some external link. All these redirections should be 301 and also non to www. These domain names have been setup at the DNS level. Instead of adding virtual host for hasting.com in sun web server. Our company wants to add all these subdomains of all websites in one instance of apache web server. Is it possible to do? - Thanks, Charan - The official User-To-User support forum of the Apache HTTP Server Project. See http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org " from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
Re: [us...@httpd] Enabling Server Side Includes in Apache2.2
try this AllowOverride None Options IncludesNoExec AddOutputFilter Includes .html AddType text/html .shtml AddType text/html .htm AddOutputFilter INCLUDES .shtml AddHandler type-map var Order allow,deny Allow from all On Thu, Dec 17, 2009 at 8:52 AM, Greene, Gregory wrote: > Can anyone help a new user of Apache2.2? I’m trying to enable SSI on the > server but don’t seem to > > be having much luck. I’ve looked on google and in the FAQ and put into > place what seems to be fairly > > straightforward edits but it never works. Hoping someone can point me in > the right direction. > > > > Here’s what I put in my httpd.conf file: > > > > > > Options Indexes FollowSymLinks Includes > > > > AllowOverride None > > > > Order allow,deny > > Allow from all > > > > AddType text/html .html > > AddOutputFilter INCLUDES .html > > AddType text/html .htm > > AddOutputFilter INCLUDES .htm > > > > > > I also tried experimenting with the XBitHack directive but it didn’t help > either. Beginning to wonder if > > my HTML code to include is just not in the right format. It did work when I > ran this webserver on > > Windows 2003 Server but perhaps it’s not compatible with Apache/Linux. Here > is the line I’m looking > > to include: > > > > > > > > I have a bunch of galleries of images in a directory structure in > /var/www/html. Do you have to define > > each and every one in the httpd.conf file? I tried doing that for one > gallery but it didn’t work either. > > > > Any thoughts? Thanks in advance. > > > > Greg -- Thanks, Charan - The official User-To-User support forum of the Apache HTTP Server Project. See http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org " from the digest: users-digest-unsubscr...@httpd.apache.org For additional commands, e-mail: users-h...@httpd.apache.org
[us...@httpd] redirecting index.jsp to its folder
Hi, for the website I'm migrating, all the folders have their welcome page as index.jsp and that page is in the weblogic. If I click on any link it's going until the folder but not picking up the index.jsp. Suppose that I have the below folders, how can I have a generic rule using Rewrite module for redirecting them to default index.jsp /ar --> should redirect to /ar/index.jsp /ar/sample/product-id-sample --> should redirect to /ar/sample/product-id-sample/index.jsp /ar/sample/articles-tips --> should redirect to /ar/sample/articles-tips/index.jsp /ar/start/getting-started-faqs --> should redirect to ar/start/getting-started-faqs/index.jsp /ar/ongoingsupport/all-faqs --> should redirect to /ar/ongoingsupport/all-faqs/index.jsp /ar/start/insurance-basics --> should redirect to ar/start/insurance-basics/index.jsp /as --> should redirect to /as/index.jsp /as/start/starting-treatment --> should redirect to /as/start/starting-treatment/index.jsp -- Thanks,
Re: [us...@httpd] redirecting index.jsp to its folder
Is it possible to use DirectoryIndex eventhough I dont have the index.jsp in the docroot On Mon, Feb 15, 2010 at 4:21 PM, Igor Cicimov wrote: > Don't need redirect have a look at DirectoryIndex directive. > > e.g. > DirectoryIndex index.jsp > > Igor > > > On Tue, Feb 16, 2010 at 10:59 AM, Charan wrote: > >> Hi, >> >> for the website I'm migrating, all the folders have their welcome page as >> index.jsp and that page is in the weblogic. >> If I click on any link it's going until the folder but not picking up the >> index.jsp. Suppose that I have the below folders, how can I have a generic >> rule using Rewrite module for redirecting them to default index.jsp >> >> /ar --> should redirect to /ar/index.jsp >> /ar/sample/product-id-sample --> should redirect to >> /ar/sample/product-id-sample/index.jsp >> /ar/sample/articles-tips --> should redirect to >> /ar/sample/articles-tips/index.jsp >> /ar/start/getting-started-faqs --> should redirect to >> ar/start/getting-started-faqs/index.jsp >> /ar/ongoingsupport/all-faqs --> should redirect to >> /ar/ongoingsupport/all-faqs/index.jsp >> /ar/start/insurance-basics --> should redirect to >> ar/start/insurance-basics/index.jsp >> /as --> should redirect to /as/index.jsp >> /as/start/starting-treatment --> should redirect to >> /as/start/starting-treatment/index.jsp >> >> -- >> Thanks, >> >> > -- Thanks, Charan
Re: [us...@httpd] redirecting index.jsp to its folder
I tried but that didn't work for me. One concern I have is how can Apache look for the index.jsp when they are in a war file which is deployed onto weblogic. Apache can look for files only under the docroot. On Mon, Feb 15, 2010 at 7:43 PM, Igor Cicimov wrote: > http://httpd.apache.org/docs/2.2/mod/mod_dir.html#directoryindex > > > On Tue, Feb 16, 2010 at 1:42 PM, Charan wrote: > >> Is it possible to use DirectoryIndex eventhough I dont have the index.jsp >> in the docroot >> >> >> On Mon, Feb 15, 2010 at 4:21 PM, Igor Cicimov wrote: >> >>> Don't need redirect have a look at DirectoryIndex directive. >>> >>> e.g. >>> DirectoryIndex index.jsp >>> >>> Igor >>> >>> >>> On Tue, Feb 16, 2010 at 10:59 AM, Charan wrote: >>> >>>> Hi, >>>> >>>> for the website I'm migrating, all the folders have their welcome page >>>> as index.jsp and that page is in the weblogic. >>>> If I click on any link it's going until the folder but not picking up >>>> the index.jsp. Suppose that I have the below folders, how can I have a >>>> generic rule using Rewrite module for redirecting them to default index.jsp >>>> >>>> /ar --> should redirect to /ar/index.jsp >>>> /ar/sample/product-id-sample --> should redirect to >>>> /ar/sample/product-id-sample/index.jsp >>>> /ar/sample/articles-tips --> should redirect to >>>> /ar/sample/articles-tips/index.jsp >>>> /ar/start/getting-started-faqs --> should redirect to >>>> ar/start/getting-started-faqs/index.jsp >>>> /ar/ongoingsupport/all-faqs --> should redirect to >>>> /ar/ongoingsupport/all-faqs/index.jsp >>>> /ar/start/insurance-basics --> should redirect to >>>> ar/start/insurance-basics/index.jsp >>>> /as --> should redirect to /as/index.jsp >>>> /as/start/starting-treatment --> should redirect to >>>> /as/start/starting-treatment/index.jsp >>>> >>>> -- >>>> Thanks, >>>> >>>> >>> >> >> >> -- >> Thanks, >> Charan >> > > -- Thanks, Charan
Re: [us...@httpd] server Error 500: howto examine what apache got
I guess you can use live http headers addon from firefox. Thanks, Charan On Mon, Mar 15, 2010 at 8:41 AM, anton wrote: > Hi, > > I get an error "Premature end of script headers:" > > Now, I know that apache get some wrong code, > but I would like to get (to log in a file) this > data which apache gets. > > Its a perl/cgi script which executes a php script and sends the result > back. > > How can I "sniff" what apache gets back from a cgi (or php script)?? > > I didn't find information about this in the wiki or in the documentation, > but other people get 500 errors too ... so there must be any possibilities > to examine such an error? > > Anton > > > > - > The official User-To-User support forum of the Apache HTTP Server Project. > See http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org > " from the digest: users-digest-unsubscr...@httpd.apache.org > For additional commands, e-mail: users-h...@httpd.apache.org > >
Re: [us...@httpd] Apache/2.2.13 : Starting httpd: (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 error
I remember this has happened to me once. if there is SELinux, disable it and try again Thanks, Charan On Fri, Apr 2, 2010 at 9:08 PM, Ravi Roy wrote: > > > On Sat, Apr 3, 2010 at 9:13 AM, Nilesh Govindarajan wrote: > >> On 04/03/10 07:53, Ravi Roy wrote: >> >>> >>> >>> On Fri, Apr 2, 2010 at 9:57 PM, Nilesh Govindarajan >> <mailto:li...@itech7.com>> wrote: >>> >>>On 04/02/10 21:52, Ravi Roy wrote: >>> >>>Hi >>>I installed Apache/2.2.13 (Unix) on CentOS 5.4. My prolbem is >>>that when >>>I try to start and stop it using "sudo /etc/rc.d/init.d/httpd >>>start / >>>stop / restart" >>>It gives me the following, I googgled a lot but could not really >>>find a >>>solution. >>>1.Command : $ sudo /etc/rc.d/init.d/httpd start >>>Error Message : >>>Starting httpd: (98)Address already in use: make_sock: could not >>>bind to >>>address 0.0.0.0:80 <http://0.0.0.0/> <http://0.0.0.0/> < >>> http://0.0.0.0:80 <http://0.0.0.0/> >>><http://0.0.0.0/>> >>> >>> >>>no listening sockets available, shutting down >>>Unable to open logs >>> >>> [FAILED] >>>2. Command : $ sudo /etc/rc.d/init.d/httpd stop >>>Error message : >>>Stopping httpd: >>> [FAILED] >>>3.Command : $sudo /etc/rc.d/init.d/httpd restart >>>Error message : >>>Stopping httpd: >>> [FAILED] >>>Starting httpd: (98)Address already in use: make_sock: could not >>>bind to >>>address 0.0.0.0:80 <http://0.0.0.0/> <http://0.0.0.0/> < >>> http://0.0.0.0:80 <http://0.0.0.0/> >>><http://0.0.0.0/>> >>> >>> >>>no listening sockets available, shutting down >>>Unable to open logs >>> >>> [FAILED] >>>Can sombody help me on this please? >>>Thanks! >>>-RR >>> >>> >>>Some other process is already running at port number 80. Use netstat >>>-ltnp | grep ':80' to get the process name and pid. >>> >>> Thanks Nilesh, netstat reveals the following : >>> tcp0 0 :::80 >>> :::*LISTEN 2056/httpd >>> Strange thing I notice is that start / stop / restart fails, but >>> service is still started, I am just curious if service is failed to >>> start (as error message explains) how come it is started at the first >>> place? >>> To my view a command 'stop / restart' should kill a started process >>> and free the port '80' and next initialization should get the port >>> without any error. >>> My http configuration have 'Listen 80' >>> Not much into linux stuff. Forgive me if I am wrong somehere and >>> correct me please. >>> Thanks for your help. >>> - RR >>> >>> >> Try using the /sbin/service command instead of this. >> >> Also, your httpd is self compiled or installed using yum ? >> >> And did you make any alterations (or created) /etc/rc.d/init.d/httpd ? >> >> >> Thanks Nilesh, > > I tried ; > > command : sudo /sbin/service httpd restart > > Error message : > > Stopping httpd:[FAILED] > Starting httpd: (98)Address already in use: make_sock: could not bind to > address 0.0.0.0:80 > no listening sockets available, shutting down > Unable to open logs >[FAILED] > I compiled httpd server is myself on CentOS 5.4, I did not make any > alterations to /etc/rc.d/init.d/httpd. > > Thanks > > -RR > >
[us...@httpd] forward requests to apache web server from sun
Hi all, I'm not sure whether this is really possible, but I wanted to know whether the below description will work for me or not I want to keep Sun Web server facing internet and keep apache in between sun web server and WebLogic. Is this really possible? Thanks,
[us...@httpd] redirecting to index.jsp using rewrite rules
Hi, I'm using the below rule to redirect to index.jsp if user doesn't add index.jsp to the url. Is it possible to have one rule instead of the below repeating rule. RewriteEngine On RewriteCond %{REQUEST_URI} /en/[a-z]*/$ RewriteCond %{REQUEST_URI} !\.jsp$ RewriteRule ^(.*)$ $1index.jsp [R=301,L] RewriteCond %{REQUEST_URI} /en/[a-z]*/[a-z]*_?[a-z]*/$ RewriteCond %{REQUEST_URI} !\.jsp$ RewriteRule ^(.*)$ $1index.jsp [R=301,L] Thanks, Charan
Re: [us...@httpd] Re: redirecting to index.jsp using rewrite rules
Thank you, this worked for me On Mon, May 3, 2010 at 12:10 PM, Dan Poirier wrote: > On 2010-05-03 at 14:46, Charan wrote: > > > Hi, > > > > I'm using the below rule to redirect to index.jsp if user doesn't add > > index.jsp to the url. Is it possible to have one rule instead of the > below > > repeating rule. > > > > RewriteEngine On > > RewriteCond %{REQUEST_URI} /en/[a-z]*/$ > > RewriteCond %{REQUEST_URI} !\.jsp$ > > RewriteRule ^(.*)$ $1index.jsp [R=301,L] > > RewriteCond %{REQUEST_URI} /en/[a-z]*/[a-z]*_?[a-z]*/$ > > RewriteCond %{REQUEST_URI} !\.jsp$ > > RewriteRule ^(.*)$ $1index.jsp [R=301,L] > > Why not > > RewriteEngine On > RewriteRule ^(.*/)$ $1index.jsp [R=301,L] > > > - > The official User-To-User support forum of the Apache HTTP Server Project. > See http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org > " from the digest: users-digest-unsubscr...@httpd.apache.org > For additional commands, e-mail: users-h...@httpd.apache.org > >
Re: [us...@httpd] IP based redirect with mod_rewrite
Wouldn't this work if we enable X-Forwarded headers on the Load Balancers. Thanks, Charan On Wed, May 5, 2010 at 6:54 PM, Igor Cicimov wrote: > Yeah that's what I was suspecting. Because of the F5 masquerading the > apache is not getting the client IP but the one set by F5. > > The simplest solution would be to set the rule you need on the F5 load > balancer than on apache server. > > Igor > > > On Thu, May 6, 2010 at 11:36 AM, Priya Vadlakonda (Contractor) < > priya.vadlako...@ucop.edu> wrote: > >> If I remember right, I think when I set the log for debugging >> >> The rule does not seem to work as expected and is checking proxy ip >> instead of client ip >> >> Anyway, to be sure I will set up the rule yet again and send you the log >> snippet. >> >> Thanks >> Priya >> >> -- >> *From*: Igor Cicimov >> *To*: users@httpd.apache.org >> *Sent*: Wed May 05 18:27:11 2010 >> *Subject*: Re: [us...@httpd] IP based redirect with mod_rewrite >> I wonder why the %{REMOTE_ADDR} approach is failing? Are you getting a >> wrong REMOTE_ADDR or your rule is not working? Can you please post your >> rewrite rule for that case and appropriate rewrite logs with RewriteLogLevel >> set as high as possible for debugging? >> >> You can also try to combine SetEnvIf and mod_rewrite for Remote_Addr >> parameter but if the above try is failing this one should be failing too >> since practically both are checking the same variable. >> >> Igor >> >> On Thu, May 6, 2010 at 6:09 AM, Priya Vadlakonda (Contractor) < >> priya.vadlako...@ucop.edu> wrote: >> >>> Hi >>> >>> >>> >>> How do I set up a rule in Apache( If at all that is possible) to redirect >>> traffic based on the IP address of the client. >>> >>> >>> >>> Here is the set up of the env >>> >>> >>> >>> There is a reverse proxy (F5 LTM) that does SSL offloading and this is >>> the first point the user hits and this does load balancing across our Apache >>> Web Servers. >>> >>> >>> >>> So, we have Apache as a proxy server that sits behind the firewall and >>> this is the second entry point. >>> >>> >>> >>> The problem is I would need to set up a rewrite rule in Apache that >>> diverts user to a web page depending on the original IP address of the >>> client. >>> >>> >>> >>> We run Apache v2 and use {X-Forwarded-For}i feature that enables us to >>> record the IP address of the client in the access log. >>> >>> >>> >>> In the access log I get both the F5 proxy IP and also the original >>> client IP. >>> >>> >>> >>> wsad...@dolores:/etc/apache2> rpm -qa | grep apache2 >>> >>> apache2-2.0.49-27.38 >>> >>> apache2-worker-2.0.49-27.38 >>> >>> >>> >>> Now the condition and rule >>> >>> >>> >>> As soon as the client hits the F5 and the request is sent to Apache, I >>> need Apache to make a decision by getting the actual client IP and routing >>> to the appropriate web page. >>> >>> >>> >>> Say if the user is accessing a URI /* and the request is coming from >>> within 128.48.0.0/16 or ucop.edu domain >>> >>> >>> >>> I need users to get to https://sseqa.ucop.edu/* >>> >>> >>> >>> For any other client IP requesting the same URI, Apache should make a >>> decision to re route the request to a different site https:// >>> >>> >>> >>> How do I do that? >>> >>> >>> >>> Any support is appreciated. >>> >>> >>> >>> I tried several ways to establish this but each time it fails. I don’t >>> have the failure logs for one particular attempt. >>> >>> >>> >>> %{REMOTE_ADDR} >>> >>> %{HTTP:X-FORWARDED-FOR} >>> >>> %{REMOTE_HOST} - When trying for a domain based redirect >>> >>> >>> >>> Thanks >>> >>> Priya >>> >>> >>> >>> >>> >> >> >
[us...@httpd] HTTP_HOST in logs
Hello, I'm using rewrite module to redirect some of the aliases.I have configured around 10 aliases like this. How can I get the alias name in the access logs. I don't want to use rewrite log here. Thanks, Charan
Re: [us...@httpd] HTTP_HOST in logs
thanks a lot. It works Thanks, Charan On Sat, Sep 4, 2010 at 2:30 AM, Rainer Jung wrote: > On 03.09.2010 18:39, Charan wrote: > >> Hello, >> >> I'm using rewrite module to redirect some of the aliases.I have >> configured around 10 aliases like this. How can I get the alias name in >> the access logs. I don't want to use rewrite log here. >> > > What about: > > %{Host}i > > Regards, > > Rainer > > > - > The official User-To-User support forum of the Apache HTTP Server Project. > See http://httpd.apache.org/userslist.html> for more info. > To unsubscribe, e-mail: users-unsubscr...@httpd.apache.org > " from the digest: users-digest-unsubscr...@httpd.apache.org > For additional commands, e-mail: users-h...@httpd.apache.org > >