Removing Apache Vhost - apache

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.

Related

http://localhost is getting forwarded

I am using Xampp and in my htdocs directoy I have a folder called 'task4u'. If I go to http://localhost, I'll get forwarded to the page of 'task4u' (which is a Symfony 4 application).
In htdocs I have now created a new folder for a new website but I still get forwarded to the directory 'task4u'.
I have checked the windows file 'hosts' but there is nothing related to this issue.
Where could that forwarding be set? Is that because of Symfony itself maybe?
Windows host file contains only a redirect to 127.0.0.1 (loopback address) for "localhost" (or you can configure more redirects to 127.0.0.1).
You have to give a look to httpd.conf Apache file; it should be under this path for a XAMPP installation: C:\XAMPP\apache\conf\httpd.conf. Open httpd.conf with a text editor and change it with your new directory path under DocumentRoot C:/your/path and < Directory C:/your/path/>
Remember to restart Apache server by XAMPP interface.

Apache httpd.conf strange behavior and virtual host setup

I want to setup a virtual host and couldn't.
Checking better, I discovered that the server always opens the index page from the root, no matter what it is in the httpd.conf file or even in the httpd-vhosts.conf file.
As a test I deleted everything from the httpd.conf file and saved it as empty file and restarted Apache. It still opens the index.php file from the root. So how does it know the root, if there's nothing in the config file, in the first place..?
I cleared the cache with htcacheclean, but same result.
If I setup a virtual host with root in a subfolder and access it at http://site1.localhost, it doesn't open the index from the site1 subfolder, but again only the one from the root.
More than that, instead of site1 I can type anything, literally, and it wouldn't give error, it will open the same index.php file in the root.
What could be the problem..?
I figured it out.
The server was working fine. It was that when I restarted it from shortcut in Programs, after making modifications in httpd.conf and other files, it was not actually restarting, like I believed.
I restarted it from the Services, and then it worked... quite weird behavior..
Anyway, thanks for caring.

Apache URI path recognition / mapping?

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.

MAMP htdocs on different drives

So I upgraded my MacBook Pro to use an ssd + hdd mixed drive setup. Before my mixed drive setup, MAMP and htdocs sat in the root Application folder. Now, I want MAMP to be able to stay in the root folder on my ssd but read the web apps that will be located in the hdd. I've tried to go into MAMP preferences > apache and set the directory for htdocs into the other volume but it doesn't seem to work. Is this even possible or is there another solution that I am unaware of?
Virtual Hosts
You can do it manually per host in httpd.conf
e.g.
<VirtualHost *:80>
ServerName example.dev
DocumentRoot "/Users/joe/webroot/dangermoose.dev"
</VirtualHost>
Read this | Step 3 – Virtual Host
and more useful hints.
If you are using the standard MAMP (3.0), the htdocs folder is located in /Applications/MAMP/htdocs. Delete the folder and replace it with a symlink to wherever you like. You might also copied the two files in the original directory to their new home.
You cannot change the installation path.
But you can change the path of the main folder where the projects are stored.
Open Mamp > Preferences > Server > Сhoose where the new project folder will be > Just open the newly created folder and delete index.html
It is not necessary to delete the old folder in which there are already projects. You can switch between folders before starting the server

WAMP Server directing me to internet locations when I click on the folders in www folder

I installed WAMP Server on my laptop, which is running Windows 8 Pro.
I created a number of folders in the www folder in the wamp folder. My problem is that whenever I try accessing the folders from the localhost page in my web browser, I am taken to the internet page of the folder i.e. I have two folders named family & prestashop. Whenever I click on them, a tab opens in my browser directing me to http://family/ instead of http://localhost/family/
What could be the problem?
Without seeing your httpd.conf (or httpd-vhosts.conf) it is hard to say where your problem is (or why it is a problem). Usually, to set up multiple sites, you will add virtual hosts to your httpd.conf or httpd-vhosts.conf which will tell WAMP what to do when people try to access that folder. The difference between a web address that looks like http://localhost/family and http://family is probably that you have set up a virtual host which allows you to get at that directory without running through 'localhost'.
Do you have something like this in your http-vhosts.conf in C:\wamp\bin\apache\Apache<version>\conf\extras\ ?
<VirtualHost *:80>
DocumentRoot "C:\wamp/www/family/"
ServerName "family"
</VirtualHost>