Apache wildcard at domain level [closed] - apache

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have few sites, and they all have identical setup on a single server. Now, instead of the separate configuration file for each of them in sites-enabled directory, I want to have a common file.
Idea is this:
www.abc.com should have /var/www/abc as DocumentRoot,
www.xyz.com should have /var/www/xyz as DocumentRoot, etc.
All other parameteres like log files, contact emails etc should also have identical setup (abc.com should have contact#abc.com as admin email, xyz.com should have contact#xyz.com as admin email etc).
I couldnt find any tutorial on how to backreference wildcards, etc.
regards,
JP

Aha. Found the solution. VirtualDocumentRoot is the answer.
A single line like:
VirtualDocumentRoot /var/www/%0
does the job. Havent really figured the logs stuff but should be similar and easy.
See https://serverfault.com/questions/182929/wildcard-subdomain-directory-names for a nice related thread.
You gotta enable vhost_alias module for this. (sudo a2enmod vhost_alias on ubuntu).

Related

Special configuration of the vhost [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
I've got some headache trying to configure that for some days so I hope someone can help me.
I've got few sites, each one related to an FTP account. I would like to make them accessible through my man website by the url http://www.mainsite.com/site1. At this point an Alias should do the work.
However I would like to add some features such as specify the log file related to the site1 which would be in the web directory of the FTP account site1. Later, I would like to put them in /var/log and have a script to sync the log file located in the web directory with the one in /var/log so that even if a user delete the log file in the web directory, the original one is still here.
To go back to the main problem, I don't know how to do that, I tried to configure a whole vhost for the site1 but then, as the ServerName would be the same as the main site, the main site would no longer be accessible.
Any suggestions ?
You could try the ancient ServerPath directive, which will cause /site1 to be mapped to one vhost and /site2 to be mapped to another, despite having matching servername and local interface:port.

Removal of the /var/www/icons alias from Apache config [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
I have a directory called /var/www/icons on my web server, which is also referenced as an alias in my Apache config as seen below:
Alias /icons/ "/var/www/icons/"
The directory contains a number of small PNGs and GIFs, which AFAIK are unused, along with a README file.
Am I safe to remove this alias from my Apache config by commenting it out? If not, what area of my application is the removal of this likely to effect?
There is very little documentation available on this directory and I must admit i've never came across it up until now.
Most icons are used for displaying file types in directory listings. If you do not use such listings, you can safely remove alias + files. I did so and do not miss them.
It is for sure safe to remove it. Other conf files could reference /icons (e. g. the autoindex module) but apart from some not found errors nothing nasty should happen.
My advice: scan the access.log files to see if urls rooted at /icons are accessed. Delete the alias and monitor the error.log file for 404 errors.

Tomcat Multiple Localhost Instances [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
What is the smartest way to configure Tomcat to have two localhost instances?
Please note that I do not have admin rights to the system, and so don't have access to the /etc/hosts file. I would love to be able to do something like the following, but can't modify my /etc/hosts files:
http://juststuffreally.blogspot.com/2007/03/enabling-multiple-localhost-sites-in.html
I'd like to have something like this, so that my instances of localhost would look as follows:
keith.localhost.com
joe.localhost.com
...but I can't modify my /etc/hosts file =-(
Another resource that I found was this, but this gives instruction for multiple outside domains--I need multiple localhost instances:
http://iam-rakesh.blogspot.com/2009/10/hosting-multiple-domains-in-tomcat.html
Any ideas?
Thank you for your help.
You can run multiple instances of tomcat on multiple ports. You would need a unique server.xml for each instance, and each one would need different ports defined in the appropriate <Server> and <Connector> elements.
Once everything is set up, you would specify an explicit port when connecting to the instance, e.g.:
- http://localhost:8080/
- http://localhost:8081/
This document covers the process in a little more detail.

wordpress permalinks 404 [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
i've read wordpress and the post on here for fixing this and i'm stuck.
i just setup a stock apache2 server with wordpress. my default link for posts works however other options don't.
i've deleted .htaccess and let wordpress regen an not working. by the way i even chmod 666 777 660 nothing works.
The only thing in my .htaccess is two lines begin and end wordpress. i added override above all and still nothing.
I looked in apached2.conf but see no modules for loading overrides.
is this a server issue or wordpress permission or something. if I can narrow it to one side or the other.
also http.conf is empty if that helps.
I got it. had to chown www-data my /var/www
Did you enable mod_rewrite in http.conf?
Earlier SO question: How to enable mod_rewrite for Apache 2.2

How do I change default directory and index file for Apache (installed via XAMPP) [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 10 years ago.
Improve this question
How do I change default Directory and index File for Apache (installed via XAMPP) so instead of looking for htdocs and index, it looks for myPath and myFile, respectively?
The research link you pasted has the first part of the answer to your question, changing the path you want serve but the second part of your question, making it serve "myFile" as the Index is an additional step. See:
http://httpd.apache.org/docs/2.0/mod/mod_dir.html#directoryindex
So you would add this line inside the relevant tags or even loose in the main httpd.conf file (see the Context section of the above link for valid places to use this directive):
DirectoryIndex myFile.ext
Hope this helps.
Edit the httpd.conf file - the DocumentRoot directory can be updated to whichever directory you would like (and that the process has permissions to). See:
http://httpd.apache.org/docs/2.0/mod/core.html#documentroot
DocumentRoot /usr/web