wamp - www directory doesnt open new document root - apache

I have changed default c:/wamp/www/ path to new directory c:/projectfolder/www/ in http.conf
The change has reflected, however when I click on the www directory in the wamp system tray (in windows 7), its still opening the old location c:/wamp/www/
I have restarted the service and exited wamp and relaunched and also rebooted the system but it still opens the old location.
Is this path taken from wamp settings somewhere instead of httpd.conf?
Note: Its not an issue for me except that I have to create a shortcut in explorer but I am running with another issue with flex, which I am not sure is anyway related to this.

Change the following part in the file C:\wamp\wampmanager.ini
[Menu.Left]
Type: item; Caption: "www directory"; Action: shellexecute; FileName: "c:/projectfolder/www/"; Glyph: 2
Here change the FileName to your new folder
Also change the following line in C:\wamp\scripts\config.inc.php
$wwwDir = 'c:/projectfolder/www';//To ur new project directory

If WAMP has default installation then you need to make changes into following file to change the directory of "www"
go to C:\wamp\bin\apache\Apache2.2.17\conf
Open httpd.conf file
Search for
DocumentRoot "c:/wamp/www/"
replace this line with your new directory
e.g DocumentRoot "d:/Sites/www/"
Then search for <Directory "c:/wamp/www/">
and replace with <Directory "d:/Sites/www/s">
Hope it will helps ..

Just as I had tried everything (including all the suggestions above and uninstalling and starting with a clean install), I was about to call the Exorcist. That's when it dawned on me that Virtual Hosts might be interfering with how URLs are mapped to files (a far fetch obviously, but all other possibilities had been exhausted).
Anyway, long story short, commenting out this line towards the bottom of httpd.conf did the magic for me.
# Virtual hosts
#Include conf/extra/httpd-vhosts.conf
I am not sure how this gotcha could be happening only to me. Alternatively, I don't get why this is not more prominently documented, since I expect that many, like me, are installing WAMP to have a quick LAMP environment on their windows machine. Wampserver 3.0.4 here...

Related

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.

When typing "localhost" in the address bar, I want to see a directory of files/folders

I recently installed XAMPP. I notice that when I type 'localhost' in the address bar of my browser, it shows a nice XAMPP welcome page. But I wish I could figure out how to show a directory of files and folders in my htdocs. I've seen this work on my old stack - 'parent directory', etc.
I've been digging around my httpd.conf file, and have found things on Google about AllowOverride, etc. Other sources say I should write a .htaccess file, but I can't get clarity on how to tweek my settings somehow to make this work.
Thanks!
Turn on your directory listing in apache configuration filehttpd.conf
For example if you projects are in /var/www/html, edit httpd.conf to add
<Directory /var/www/html >
Options Indexes FollowSymLinks
</Directory>
Following this, restart the httpd service

How do I find my httpd.conf file?

*Edit: Anyone who's using MAMP PRO on a Mac running Mac OS X Lion may find it helpful to know that I finally tracked down my httpd.conf file in my personal library at Application Support > appsolute > MAMP PRO > httpd.conf. The reason I couldn't find it with a normal search is that it's a hidden directory. To access it, open Finder, Choose Go > Go To Folder, then type in ~/Library After tracking it down, you may then discover that it's almost impossible to edit your httpd.conf file. ); *
This is a weird one. I'm using MAMP on a Mac and want to modify my httpd.conf file so it defaults my URL's to lower case. So I navigated to Applications > MAMP > conf > apache > httpd.conf and added this line of code:
RewriteMap tolower int:tolower
I then modified one of my .htaccess files accordingly, but nothing happened. (Yes, I restarted my servers.)
I then reopened my httpd.conf file and added this code, which I understand is supposed to display "verbose" messages in my log file:
LogLevel trace8
I then opened my log file # Application > MAMP > logs > apache_error.log. There's code associated with the web pages I most recently visited, but they're just generic messages - not "verbose" messages.
Someone who understands Apache far better than me told me this indicates that the httpd.conf file I modified isn't being used by my server or sites. In other words, there must be another httpd.conf file out there somewhere.
Sure enough, I typed httpd.conf into Apple's finder and found half a dozens files with that name. I don't know where they came from; I recently tried to install Drupal and Aqquia, so that might be where some of them originated.
Anyway, I added the code (including LogLevel trace8) to EVERY httpd.conf file, restarted my servers, and I STILL don't see any changes on my websites, and I still just see generic code in my log file.
I'm completely snowed. It looks like the httpd.conf file in my MAMP folder is out of the loop, yet the Apache log file in the same folder is being used...or can errors be written to more than one Apache log file at the same time?
If I rename the httpd.conf file in my MAMP folder and restart my servers, my sites display fine, further suggesting that this httpd.conf is outside the flow. Yet if I rename a file that sits beside it named mime.types, my web pages don't display.
Anyway, does anyone have any idea how I can figure out what's going on?
If not, then can you advise me on Plan B? If I can't find my httpd.conf file, then I'll have to abandon ship and just do it online. I've found the path to my online httpd.conf file. I don't know how to open online files, but I assume I can copy it to my computer with an ftp program, open it and modify it, then publish it online.
So here are my questions: Am I correct in understanding that I can safely add the code RewriteMap tolower int:tolower to my online httpd.conf file without affecting any of my websites UNTIL I also modify a .htaccess file(s)? And if I modify my online config file, do i have to restart the server, just as I do on my computer?
Thanks.
First, use the ps command to find the full path to the running Apache process:
$ ps ax | grep httpd
28 ?? Ss 3:01.99 /usr/sbin/httpd -D FOREGROUND
On this system, Apache is /usr/sbin/httpd.
Second, run that binary with the -V option to show its configuration. This should include the path to the config file.
$ /usr/sbin/httpd -V
...
Server compiled with....
..
-D SERVER_CONFIG_FILE="/private/etc/apache2/httpd.conf"
On this system, the running copy of Apache reads its config from /private/etc/apache2/httpd.conf.

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.

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.