Project missing in Localhost (WAMP) - apache

I got a copy of my project from work, and put it into the www folder of Wamp, in a different PC. However, when loading localhost, I am not able to see the folder in the list.
I attempted to create a few new folders, and they display correctly in localhost. Even if I rename this folder to something else, it still refuses to show up.
This is what my www directory looks like :
And this is what localhost shows me:
Update :
If I copy the files inside mainProject and paste them into either test1 or test2, that folder disappears from localhost as well.
Update 2:
Deleting/Removing the .htaccess file from mainProject makes the folder visible in localhost, but when I try to access it, it gives me file not found error for obvious reasons! Can add snippets from the .htaccess file if needed!

You should not put anything into the \wamp\www folder, this is where the WAMPServer homepage lives in a file called index.php
So it looks from you first sentence that you have overwritten this file with one of your own projects files.
The simple solution is to install WAMPServer onto another PC and restore the \wamp\www folder from there. Alternatively uninstall WAMPServer, delete the \wamp folder and all subfolders, re-install WampServer and then copy your project into a sub folder of the \wamp\www folder. The wamp homepage is not actually required, but it can make life easier.
Also check the wampserver.com/forum/en there is a document there called 'WAMPServer 2.5 The Homepage, Your Projects Menu and the need for Virtual Hosts ' describing how to setup Virtual Hosts which also provides a more buttet proof environment to run a project in.
ADDITIONAL INFO:
Ok now you have undone the damage you did, you now need to learn how to create a Virtual Hosts for each of the projects you want to run/develop.
You can undo the changes you made to Document Root, Directory and Virtual Host in the httpd.conf file, these can all be individually set from within a Virtual host definition.
See this post on the WampServer forum site

Related

Where is the right place to configure my Apache vhosts in OSX?

I updated my laptop from Mojave to Catalina last night, and this morning I realised that I had lost all my Apache vhosts, my vhost file was replaced with the default file.
I had all my vhosts in /usr/local/etc/httpd/extra/httpd-vhosts.conf
I would like to know which is the right way to do this (store my vhosts), so I (hopefully) won't lost my vhosts in a future update.
Thanks!!
P.D. I'm using "native" Apache, not Homebrew.
Catalina moved the root directory files as part of the upgrade. See https://apple.stackexchange.com/questions/371852/where-does-the-upgrade-to-macos-catalina-move-root-directory-files
From the answer: This took me a long time to figure out, but any file that was formerly at, e.g., /my-cool-directory was moved to /Users/Shared/Relocated Items/Security/my-cool-directory.
You might try checking in your /Users/Shared/Relocated Items/Security folder for your original Apache files.
It depends on what you do include in your httpd.conf file.
You can try use a custom created vhosts file eg. Include /private/etc/apache2/extra/mycustom-httpd-vhosts.conf next time.
After the last catalina update my custom files where not moved out of their places.
I had the same issue with updating to catalina. All my changes were gone.
By default the httpd.conf includes config files in the other directory:
Include /private/etc/apache2/other/*.conf
I place my vhosts and userdir configs in this directory now. It looks like it works just fine. Another custom file I had in there was not touched by the update.

How do I get apache to follow symlinks to windows drive on WSL

I'm trying to make apache run on Linux Subsystem for Windows.
So I just installed apache and changed DocumentRoot from "/var/www/html" to "/var/www" in /etc/apache2/sites-available/000-default.conf.
This has exactly the effect I wanted it to have, namely to list all folders inside when browsing to "localhost".
My projects are located on my Windows drive in "C:/Projekte", so I created a symlink like so:
sudo ln -s /mnt/c/Projekte /var/www/projects
Now my problem is, when I browse to localhost and click on projects it runs into a loop trying to call an index.html, so the url before it breaks looks like this:
http://localhost/projects/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/index.html/
I would want to see the directory listing of my folders instead.
I know about the Options Indexes and FollowSymLinks which are both set, but there seems to be something else I have to set for symlinks to work as I expect.
If I create a folder instead in "/var/www" it works fine.
Does anybody know how to set this up correctly?
By accident I found out, that my issue here is related to this issue on BashOnWindows. Problem is that I used tab to autocomplete the path which automatically added a trailing slash to the end of the path. So the actual command I used to create the symlink was
sudo ln -s /mnt/c/Projekte/ /var/www/projects
Creating the symlink without trailing slash, just like in my question it works just fine.

Using a symlink as the document root in MAMP hosts

I'm using MAMP PRO v3.0.7.2
I want to specify a symlink as the document root for a specific entry in MAMP Pro's host section which points to the latest build of my project, which can change many times a day during development. The problem is when I select this symlink as my document root, MAMP rewrites the path to match whichever directory to symlink is pointing to.
The build script for my project updates that symlink to point to the latest release directory on every rebuild, but MAMP still has that previous release as the document root.
So for example I want the document root to be:
/Users/username/Sites/projectname/live
which is a symlink that currently points to a directory:
/Users/username/Sites/projectname/releases/2014-10-24-17_25_52
MAMP does not respect the symlink path, but instead rewrites it to
/Users/username/Sites/projectname/releases/2014-10-24-17_25_52
So when I rebuild my project later, MAMP is still pointing the document root to the path above, but /live is now pointing to
/Users/username/Sites/projectname/releases/2014-10-24-18_17_48
In the past I have configured Apache manually and it was fine with using the symlink as the document root, and whenever I rebuilt the project the most current build resolved at the URL defined in vhosts without having to edit anything or restart Apache.
I tried manually editing the respective VirtualHost entry MAMP's httpd.conf file in Library/Application Support/appsolute/MAMP PRO/conf/httpd.conf, but whenever the server is restarted it overwrites my changes and rewrites all instances of the path back to whatever directory the /live symlink is currently pointing to.
Is there a way around this so that I can specify a symlink as the document root, and have it always point to that symlink rather than the actual directory that is currently being symlinked to? Otherwise I have to manually change it and restart servers many extra times a day, which gets old pretty fast.

can I install wamp twice in different folders?

I'm facing a problem due to the folder name "Program Files" in which my wamp is installed.
I'm using Yii Framework to create a web app.
While running a command
yiic webapp c:\Program Files\wamp\www\YiiApp
it gives error due to the white space in the folder name.
The error is as below:
C:\Program Files\wamp\www\yii-1.1.13.e9e4a0\framework>yiic webapp c:\Program Fil
es\wamp\www\YiiApp
Error: Unsupported VCS specified. Currently only git and hg supported.
USAGE
yiic webapp <app-path> [<vcs>]
DESCRIPTION
This command generates an Yii Web Application at the specified location.
PARAMETERS
* app-path: required, the directory where the new application will be created.
If the directory does not exist, it will be created. After the application
is created, please make sure the directory can be accessed by Web users.
* vcs: optional, version control system you're going to use in the new project.
Application generator will create all needed files to the specified VCS
(such as .gitignore, .gitkeep, etc.). Possible values: git, hg. Do not
use this argument if you're going to create VCS files yourself.
What should I do? Please suggest me something.
The second install will have superceeded the first. In other words Wampmanager and Apache and MySQL will be being started out of the new folder.
As per your question on wamp forum, copy wwww/subfolders into the new location and then copy ONLY YOUR databases from mysqlx.y.z/data into the same place in the new location.
Then delete the folders from program files.
You only need one wamp ( Apache/MySQL) per system.
I tried something else:
Without moving the previously installed wamp's content just read the
"uninstall_services.bat" file
just uninstall these services from that wamp directory which you want to disable.
Still the another wamp's services won't start. So install those services mentioned in "uninstall_services.bat" file manually from respective directories.
Now Restart All Services from the tray icon. The required wamp will be enabled.
If won't, try it again. No need to reinstall wamp.

Apache Installation

I just installed Apache 2.2.x in my windows 7 x64. everything seemed okey and I am getting the "It works!" page. However when I tried to edit the index.html in htdocs and I display localhost again it just says "It works!" it didnt show the modifications that I did on the file. Is this an indication of something wrong with my installation?
I believe to change the index.html in win7x64 , you need to run your editor as an administrator , as it is located in program files folder , and to change anything in program files folder or any folder under it you need to run the editor as admin
Double check that your browser isn't caching the default page. After you make a change to your index.html, clear your browser cache and try again.
If that still doesn't work, ensure you're not editing the wrong index.html file; the default site may be pointing to a different location than the one you're editing. (I'd guess the issue is the browser cache, however...)
Ctrl-F5 the page for hard refresh.
If same page is there:
A) you're editing the wrong index.html/php file.
B) you're making edits that don't change the output.
If you can't get it to work, I suggest you install a full WAMP package.