MAMP htdocs on different drives - apache

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

Related

Removing Apache Vhost

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.

Changing var/www to something else

I've installed Ubuntu on a Oracle VM Virtual box, and installed Apache etc.
How do I change the var/www folder that Apache uses, to something else? Can I simply rename it? I'm, trying to change it to nordy/core, in place of var/www.
Can I create a separate folder called nordy/core and place my html files there? One of the reasons I did not do this it because I noticed that var/ has several other folders that will not be created if I simply create a new folder. So, I'm guessing the site wont work.
I'd like to store my html and php files in a folder nordy/core so Apache can use it from there. Can I simply create a folder nordy/core and point Apache to it in Apache's configuration?
How do I do this?
You need to change the value of the DocumentRoot directive of your apache2.conf file. You may find this file at /etc/apache2/apache2.conf.
DocumentRoot "/nordy/core"
Then restart your apache process.
sudo service apache2 restart

PHPMyAdmin and Security on XAMPP not working after changing DocumentRoot in httpd.conf

SUMMARY
I am unable to run localhost/phpadmin and localhost/security after changing the DirectoryRoot in XAMPP httpd.conf. This leads to two questions.
If I am using XAMPP on Windows, is there any way to run PHP files outside the localhost directory that I have set in the httpd.conf?
If "no", then how does one run files such as phpmyadmin or the security module on the local machine, if the phpmyadmin files reside in the c:\xampp directory but the DocumentRoot path in httpd.conf points to a different directory?
More detail is set out below.
BACKGROUND INFO
My installation is as follows.
Operating system: Windows 7
Version of XAMPP: xampp-portable-lite-win32-1.8.1-VC9.7z
Installation directory: c:\xampp-portable
Code files saved in: d:\dropbox\websites_user1\...
I then modified the httpd.conf as follows:
Line 191: DocumentRoot "D:/Dropbox/websites_user1"
Line 222: <Directory "D:/Dropbox/websites_user1">
The default httpd-xampp.conf configuration is unchanged - e.g.:
Line 99: Alias /phpmyadmin "/xampp-portable/phpMyAdmin/"
Line 100: <Directory "/xampp-portable/phpMyAdmin">
Line 121: <LocationMatch "^/(?i:(?:xampp|security|licenses|phpmyadmin|webalizer|server-status|server-info))">
THE PROBLEM
After changing the directory root in httpd.conf as above, I can run php files successfully from local host - e.g. localhost/project01/demo.php.
However, I now can't run PHP files from any location other than those located in the new localhost directory (i.e. d:/Dropbox/websites_user1/..). This means that I can no longer run PHP files in locations such c:\xampp\PHPMyAdmin or C:\xampp-portable\security\htdocs\security.php.
Also, the configuration for the PHPMyAdmin and Security are clearly no longer correct. For instance, if I enter "localhost/phpmyadmin" or "localhost/security", I get a "page not found" error.
This leads to two sets of questions (as summarised at the start of this question).
Is the directory configured as the localhost the ONLY location from which PHP files can be run? Is it possible to configure PHP to run from any location on my C or D drives?
If not, how do I run files such as those in PHPMyAdmin or security.php or any of the innumerable files in the other xampp directories? Do I need to copy and paste the phpmyadmin folder into my localhost folder at D:/Dropbox/websites_user1? Or into each of the individual website folders beneath that? If yes, do I then need to reconfigure any files such as http-xampp.conf?
I am relatively new to PHP and new to XAMPP. Everything was working perfectly until I ran into this ... and now I'm completely stuck if I can't use PHPMyAdmin, and can't even use the Security module to set my passwords.
Will be very grateful for advice!!
I believe you cant run anything higher than your root as a security feature. Imagine some remote person knowing your IP address and accessing all your files above your document root.

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>

how to configure xampp in windows if project files are not in root directory

i am using windows .my xampp is install in drive C ,firstly i worked here in my files
C->xampp->htdocs->SVN data->php_clients->trunks->myproject
but than for SVN i copy paste my all files here now SVN Is configured here
D->SVN data->php_clients->trunks->myproject
i am testing my project locally i mean in localhost,firstly it was in
C->xampp->htdocs->SVN data->php_clients->trunks->myproject
so i was able to work ,test,update now i am suppose to work in files which is located here
D->SVN data->php_clients->trunks->myproject
but problem is of xampp what is the nice and easy way so that i work here and work locally that is localhost
D->SVN data->php_clients->trunks->myproject
go here that is C:\xampp\apache\conf\httpd.conf
open httpd.conf
Find This DocumentRoot "C:/xampp/htdocs" Edit this to
DocumentRoot "D:/SVN data/php_clients/trunks/myproject"
after that find this tag
<Directory> and make it like this
<Directory "D:/SVN data/php_clients/trunks/myproject">
Restart Your Apache go to browser write http://localhost in address bar and see your app