I am using Apache server with Wamp to have something like this for a dev enviroment:
123.45.67.89/website-a/
123.45.67.89/website-b/
to get to this point I made 2 aliases that look like this:
Alias /website-a "c:/wamp64/www/website-a/public"
<Directory "c:/wamp64/www/website-a/public">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
#Require local
Require all granted
</Directory>
Alias /website-b "c:/wamp64/www/website-b/public"
<Directory "c:/wamp64/www/website-b/public">
Options +Indexes +FollowSymLinks +MultiViews
AllowOverride all
#Require local
Require all granted
</Directory>
the issue that I have is basically the fact that the CSS and JS files are not loaded and also when i go to /login there is a 404 error. it appears to reference only the route url and that is the IP 123.45.67.89.
What should I do in order to get this fixed?
I have a Laravel project that is on a live server and I have made a copy to place in a development server. When I try to login, it says The requested URL /xxxx/login was not found on this server..
I am not quite sure what to do, as I changed my httpd.conf to
<Directory "/var/www">
AllowOverride All
Require all granted
</Directory>
and
<Directory "/var/www/html">
AllowOverride All
Require all granted
</Directory>
but I am still getting the same error after restarting apache. Is there any way to solve this?
I think you didn't config for the virtual host or you config it wrong.
You can find that config file under folder /etc/httpd/conf.d/vhosts/ Below are a sample file config:
$ cat /etc/httpd/conf.d/vhosts/yoursife.conf
<VirtualHost *:80>
ServerName yourdomain.com
ServerAdmin youradmin_server_mail
DocumentRoot /your_src_path/public/
<Directory "/your_src_path/public/" >
Options FollowSymlinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
ErrorLog /your_src_path/public/logs/error_log
CustomLog /your_src_path/public/logs/access_log combined
</VirtualHost>
You can create a new file if you want.
I need to create a site but when i start apache2 services i don't have permission.
My site contains ruby and apache, i need ruby app on my apache2
That my apache2 config.
<Directory />
Options FollowSymLinks
AllowOverride None
Require all granted
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/Pass>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
/Pass is my folder with my ruby app.
Thanks for you help !
Sorry i'm not on my linux last time... i does install_passenger_apache2 and i have this
enter image description here
Web Directory Structure
~/Sites/
./subdomain1.site.com/
./cgi-bin/
./subdomain2.site.com/
./cgi-bin/
~/Remote/
./subdomain1.remote.com/
./cgi-bin/
./subdomain2.remote.com/
./cgi-bin/
/private/etc/apache2/users/< username >.httpd:
<Directory ~ "/Users/<username>/Remote/.*">
Options Indexes Includes SymLinksIfOwnerMatch MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory ~ "/Users/<username>/Remote/.*/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
## Same thing as above, but using "Sites" instead of "Remote"
<Directory ~ "/Users/<username>/Sites/.*">
Options Indexes Includes SymLinksIfOwnerMatch MultiViews
AllowOverride None
Order allow,deny
Allow from all
</Directory>
<Directory ~ "/Users/<username>/Sites/.*/cgi-bin">
AllowOverride None
Options +ExecCGI
Order allow,deny
Allow from all
</Directory>
I copied Sites into Remote and restarted apache (sudo apachectl restart) -- also, tried stopping, then starting to be thorough.
Directories contain the same permissions
index.html loads for the Sites directory, but not Remote, despite being the same file
URL looks like: http://localhost/~<username>/<directory in Sites or Remote>/index.html
There's nothing in httpd.conf that enables /apache2/users/<username>.httpd config, it just seems to work for Sites/, but not Remote/
In OSX-Mavericks, httpd.conf includes /extra/httpd-userdir.conf by default. This is where the "Sites" directory is being set.
Inside your setup, edit https-userdir.conf and add the line UserDir Remote. This should enable both directories in your home folder.
I'm running Apache on Windows XP via Xampplite, and could use help configuring my virtual directory. Here's what I'm hoping to do on my dev box:
I want my source files to live outside of the xampp htdocs dir
on my local machine I can access the project at http://myproject
others on my local network can access the project at my.ip.address/myproject
keep localhost pointing to the xampp's htdocs folder so I can easily add other projects.
I've got 1 & 2 working by editing the windows hosts file, and adding a virtual directory in xampp's apache\conf\extra\httpd-vhosts.conf file. I don't immediately see how to do 3 without messing up 4.
Figured it out: use Alias for #3, instead of VirtualHost, thus:
Alias /myproject "C:/path/to/my/project"
<Directory "C:/path/to/my/project">
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
To accomplish your list of needs.
1) Make the directory:
mkdir c:\xampp\sites\myproject
2) Edit c:\windows\system32\drivers\etc\hosts so it contains this line:
127.0.0.1 myproject
and add the following to c:\xampp\apache\conf\extra\httpd-vhosts.conf:
NameVirtualHost myproject:80
<VirtualHost myproject:80>
DocumentRoot c:/xampp/sites/myproject
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
3) Add the following lines to the end of c:\xampp\apache\conf\httpd.conf:
Alias /myproject/ "/xampp/sites/myproject/"
<Directory "/xampp/sites/myproject">
AllowOverride None
Options None
Order allow,deny
Allow from all
</Directory>
4) Leave DocumentRoot, Directory, etc in c:\xampp\apache\conf\httpd.conf alone to accomplish this. For reference these lines would be:
DocumentRoot "/xampp/htdocs"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
First enable: LoadModule alias_module modules/mod_alias.so
<IfModule alias_module>
Alias /ddd "D:/prj/customer/www"
<Directory "D:/prj/customer/www">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
</Directory>
</IfModule>
Tested on WAMP 2.2 and its working: http:// localhost/ddd
In httpd.conf add the following lines, mutatis mutandis:
<IfModule alias_module>
Alias /angular-phonecat "C:/DEV/git-workspace/angular-phonecat"
</IfModule>
<Directory "C:/DEV/git-workspace/angular-phonecat">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride all
Order allow,deny
Allow from all
Require all granted
</Directory>
This worked great on my (Windows) XAMPP installation after restarting the Apache server. I had to add the "Require all granted", but otherwise it is pretty much the same as the above answers.
NameVirtualHost myproject:80
< VirtualHost myproject:80 >
< /Directory >
Must be:
NameVirtualHost myproject:80
< VirtualHost myproject:80 >
< /VirtualHost >
greets ;)
resolved the issue. it was missing the directory tag.
NameVirtualHost myproject:80
<VirtualHost myproject:80>
DocumentRoot "D:/Solution"
<Directory "D:/Solution">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Problem resolved in a simplest way and less steps
No Need of creating virtual host just change the location of target directory.
Here's what i have done for configuration:
I've done it by editing the C:/xampp/apache/conf/httpd.conf file
Changings that I have done in httpd.conf file
Added this script right after
ScriptAlias /cgi-bin/ "C:/xampp/apache)/"
Alias /projectXYZ "C:/pathtomyproject"
Options Indexes FollowSymLinks MultiViews ExecCGI
AllowOverride All
Order allow,deny
Allow from all
Pathtomyproject = Complete path of project
And changed the url of Document Root
DocumentRoot " C:/pathtomyproject "
Now restart the Apache Server by stopping the server.
I have stopped Apache server, and then again started the Apache Server.
Source: http://bytespedia.blogspot.com/2013/12/creating-virtual-directory-in-apache.html