how can I say to apache to go to look in the /home/user/Web folder for the project without missing the possibility to display localhost/phpMyAdmin. Itried with Alias, Document root an Virtual Host.
Related
I've set up a single VPS running Apache, with an application installed in /var/www/html/. I have a domain [example-1.com] to the server IP.
I'd also like the same application to be served on [example-2.com]. Something similar to creating an 'Alias' domain.
Is it possible to have two Virtual Host Files configured at one document root?
Yes, no problem. The document roots can point wherever you want them to. If the configuration of the second virtualhost is the same, you could also use the ServerAlias directive.
I have a website for all intents and purposes is called.
www.foobar.com
Which in my server path is /var/www/
I tried to create a new folder in /var/ called "analytics", with the hope that if I typed www.foobar.com/analytics I could access that folder.
However that does not work because it is actually looking for /var/www/analytics instead of /var/analytics
So how can I have multiple directories mapped to a URI?
For phpmyadmin I can access www.foobar.com/phpmyadmin with the phpadmin folder is in a completely different directory. So it must be possible.
However I tried googling but could not find any answers so I guess I do not have the right description of what this functionality is on Apache webservers.
Any help would be appreciated.
You have to create virtual directories in Apache.
If you are using Apache2, then can you go to the directories
/etc/apache2/sites-available and /etc/apache2/sites-enabled.
You have probably only the default virtual directory enabled.
You can make a copy of a virtual directory in the map /sites-available.
A virtual directory starts with specifying what the root directory is.
Then can you use the commands a2ensite and a2dissite in order to enable or disable the virtual directories respectively.
After a change in enabled/disabled virtual directories do you need to restart/reload the apache server.
If you use .htaccess file, do not forget to set AllowAccess (in the tag Directory) to at least FileInfo or .htaccess will be ignored.
If you want to make those directories different hosts, then can you make aliases in /etc/hosts.
On my home computer have I aliases for the ip addresses 27.0.0.1 and 27.0.1.1.
That gives me the possibility to have two different sites at the same time.
I'm in a new pc, and the previous intern has configured a virtual host(vhost) on Apache. I'm trying to remove, because i don't accessing any project on folder "www"(wampo).It always redirected to folder "bignardi"(laravel).
I remove the lines from httpd-vhosts.conf and hosts(drivers/etc - windows).
In Wamp folder i found a folder named "vhosts" and i removed the lines to create the virtual host.
I have My old domain on my server myexample.com with folder name "myexample" and a have different domain mymaindomain.com, What i am looking is whenever user opens mymaindomain.com/contest it opens the site that is in "myexample" folder and still keep the url in address bar mymaindomain.com/contest/whatever.xxx using htaccess or httpd on apache server.
Put
Alias /contest /public_html/myexample
in the virtual host definition for myexample.com. Note though, that this may cause links in your content to be wrong if they expect to be located at / instead of at /contest.
Could it be possible to create a virtual host using tomcat and apache which can be accessible in an intranet ??
I am a newbie in using jsp and tomcat but I have been able to create a virtual host, but it is not accessible in the intranet. What do I have to do to make it accessible on the intranet?
This is possible to create a virtual host using tomcat and apache. But in order to make it accessible in the local intranet you need to add an entry of your ip address to the /etc/hosts file of the memeber machines of the intranet unless they will not be able to recognize the virtual host you have created.
Which is not feasible at all because the /etc/hosts file is managed by the root itself and it is refreshed on every restart by root. You can add a sticky bit to the file but it is like an intrusion to the machine/company policies which should not be done.
:)