my localhost wamp page was working fine but due to some reason it opens the /index of page.
I need to get the main home page back. I have seen some solutions to the previous answers but all my settings are exactly as advised.
"LoadModule autoindex_module modules/mod_autoindex.so" is uncommented in the httpd.conf file.
Any help on this would be amazing.
Apache version is 2.4.41
OS: Windows 10
Cheers!
Related
I have a weird issue with localhost on my Mac. I'm trying to setup Apache server, but I'm just stuck with the localhost. So on a new tab if I type in localhost and press enter, it shows 'It works'. But if I then refresh the page, it only disconnects and says 'The site can't be reached. Localhost refused to connect.'
I've followed all the steps in several tutorials about setting this up but nothing solves this issue. Any thoughts?
Finally, I could make it work. I noticed that there was this line Include /private/etc/apache2/other/*.conf at the end of the httpd.conf file which was overwriting any of my other conf files, so it wasn't letting localhost work normally.
I first uncommented it and localhost worked, I could also see my directories in the browser. But then another issue came up, that the phpinfo.php page wasn't showing up the usual phpinfo, instead it was showing me the code in the file for rendering phpinfo.
After googling around I learnt that because I had upgraded my PHP earlier to version 7.1, this new installation uses a conf file inside the 'other' directory (read this) to make php work and also comments out the php5_module line in httpd.conf to disable older php. I had instead uncommented this line and commented out the line to include this other conf file. So in order to deal with both the first case and this one, I simply commented out php5_module line again and then moved this line for including other conf file to a place above where I was including my conf file. And everything worked :)
I'm running WAMP on Windows 10. I had an old computer where I was running WAMP on Windows 8, and the WAMP localhost homepage used to be a tree-structure list of the files:
Which seems fine; I can browse through directories and see their contents.
Now the WAMP localhost homepage is a larger page with links to the tools, projects, etc.
However, when I try to browse through any specific parent folder (with many other subfolders of projects) from a link in "Your Projects", it fails. I get a "404 Not Found - The requested URL /my-site/ was not found on this server." error.
I don´t understand why it's different now, and I'm wondering how can I get the old WAMP localhost homepage?
I have same issue on windows 10 x64.
Solution is in /wamp64 or wamp /bin/apache/apache2xxx/conf/httpd.conf . Remove comment tag (#).
#LoadModule autoindex_module modules/mod_autoindex.so
to
LoadModule autoindex_module modules/mod_autoindex.so
Then Restart Wamp server to load autoindex module.
If you want to work on apache default page www/index.php , you need change
$suppress_localhost = True;
to
$suppress_localhost = false;
Solution from: WAMP "index of / " page not working
I installed WAMP and followed this guide to set up virtual hosts. In both Google Chrome and Internet Explorer, http://localhost gets me to "WAMPSERVER homepage" with my virtual host listed under "Your Projects."
Clicking that link to http://mysite.local in Chome brings me to my site as expected.
Clicking that link in Internet Explorer displays the following message instead.
This page can’t be displayed
•Make sure the web address http://mysite.local is correct.
•Look for the page with your search engine.
•Refresh the page in a few minutes.
Since I can see the WAMPSERVER homepage as expected in both browsers, I don't think there's a problem with my WAMP installation. Since my virtual host is working in Chrome, I think it must be configured properly in Apache and in my Windows hosts file.
I just don't understand why Internet Explorer isn't working with my virtual host like I expect it to, and the "Page can't be displayed" message doesn't give me anything helpful to work with.
Does anyone have any suggestions for me? I'd greatly appreciate any pointers or links to other guides I can try. Thanks in advance for any replies!
There's several reasons WAMP/MAMP may not work on a local environment, I'll try to list a few reasons here:
Which httpd.conf?
There are sometimes multiple httpd.conf files that can cause things to go a little bit funny. MAMP/WAMP usually tend to keep all their configuration files within a conf/ directory however, that doesn't mean to say some other httpd.conf file is being used...
You can also run this command on Linux based systems to see which one is being used:
apache2ctl -V | grep SERVER_CONFIG_FILE
vhosts definitions not included in httpd.conf
In the httpd.conf file, there's a line to include the vhosts definitions file, it should be uncommented:
# Virtual hosts
# Include conf/extra/httpd-vhosts.conf // remove the #
Incorrect vhosts definitions
Vhosts need to be defined as follows:
<VirtualHost *>
DocumentRoot "C:/path/to/your/local/site"
ServerName mydomain.local
</VirtualHost>
Hosts file
On OS X/Linux systems this can be found at etc/hosts. Edit that to reflect below (note, you'll need to be root)
127.0.0.1 mysite.local
On windows systems, it can be found in %SystemRoot%\System32\drivers\etc\hosts.
Browser caches
Browser caches always cause an issue with local servers/development. It's worth working with incognito mode on, or deleting all browser caches each and every time you open it up. There's a few plugins available for most browsers that should help too.
Other points to note
Whenever you edit anything to do with httpd.conf, vhosts, hosts file - WAMP/MAMP/Apache needs to be restarted. It's a good idea to shut the server down before doing the changes.
You mentioned that there was a hardcoded link in one/some of your files. It's generally regarded as bad practise to do that for this exact reason. Your code is less portable and can 'break' on other systems. I'd suggest using PHP's __FILE__ or similar to achieve what you want.
Alternatively you could set up local configuration files for your app that are only included when they're present. Have a look at this for a good example of such a set up.
Log everything. Check the logs regularly too.
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...
I'm running a Ubuntu Sever with Apache/2.2.17. I can't seem to run JSP I just get the source code in the browser. What am I doing wrong?
Thanks
What am I doing wrong?
Expecting that Apache HTTPD magically supports JSP. It doesn't. You need Apache Tomcat instead.
See also:
Our JSP wiki page - at the bottom you can find several tutorial links to get started properly.
Try this
1)get the mod_jk.so
2)include this in httpd.conf file
LoadModule jk_module modules/mod_jk.so
3)Then in virtual host section of httpd.conf
JkMount /test/*.jsp loadbalancer
put your jsp file in webapp dir in the tomcat directory. Run as localhost:8080/your.jsp from your browser. Also make sure tomcat is set properly by running localhsot:8080 form your browser.