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

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

Related

WAMP localhost and phpmyadmin setup

I have inherited a WAMP setup, but needed my http://localhost to point to a different directory "C:/Users/[user.name]/htdocs" due to many dependencies.
I made the following changes in httpd.conf
DocumentRoot "C:/Users/[user.name]/htdocs"
<Directory "C:/Users/[user.name]/htdocs">
where the original path was "c:/wamp/www/"
Now the WAMP default path for phpMyAdmin http://localhost/phpMyAdmin is not working anymore.
Is it possible to fix that via either C:\wamp\alias\phpmyadmin.conf or httpd-vhosts.conf somehow?
Can I suggest a better solution to your requirement to have a site running that does not live in the WAMPServer default location i.e. \wamp\www or \wamp\www\somefolder
If you revert all your httpd.conf changes to the out of the box state and then create a Virtual Host to run the site you have located in your \user.... folder.
Virtual Hosts are a standard Apache feature that allows you to run may sites from a single instance of Apache, a bit like a shared hosting package setup.
You would then have the benefits of the WAMPServer homepage running on localhost and all the other alias's tools as well.
You can then run your site using a nice url for example sitename.dev and the virtual host definition also allows you to setup any site specific requirements without effecting any other site you may want to run.
There is a HowTo Setup Virtual Hosts here on SO

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

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>

MAMP just ONE virtual host not working

I wanted to start a (my first) wordpress project on my mac.
I run apache with MAMP, and wanted to make another (I allready have a few) virtual host for this particular project.
I added the host to my httpd.conf and etc/hosts file as i've done many times before.
When I browse to the url i've chosen I just end up in the directory that i've specified as root folder in my MAMP settings.
Apache seems to ignore the changes made in the httpd.conf file, but if I remove (rename) the httpd.conf file (to _httpd.conf) it apache doesn't start. so it looks like changes to this file are ignored, BUT if I put something wrong in the file apache doesn't start either...
this is what I put in the httpd.conf file to add a virtual host:
<VirtualHost *>
DocumentRoot "/Users/username/Sites/site_dir/"
ServerName local.sitename.com
<Directory "/Users/username/Sites/site_dir/">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
can this have anything to do with WP?
greets,
R.
On Windows:
Try putting it in the conf/extras/httpd-vhosts.conf instead and try
where port 80 is whatever port you have apache running on (:80 by default on windows)
and try not to use .org .com or any ending common on the web in your server name/alias use if you are developing the project on your localhost use something like sitename.local instead.
On Mac:
Not sure how it would work
On Ubuntu 11.04:
I just:
Set up a different vhost file for each site inside of /etc/apache2/sites-available
Then enable the site via a2ensite or just make a copy to the file using cp to the sites-enabled folder (all this is done via the ssh or a terminal on mac)
I then reload and restart apache and wallah!
I'm having a similar problem on one of my ubuntu servers. I'm doing something that I've done several times but all of a sudden it doesn't work. Go figure, lol! Typo? Who knows, definitely scour the web, an answer is sure to surface.