I have created a virtualhost in the /opt/lampp/etc/extra/httpd-vhosts.conf which is following-
<VirtualHost *:80>
DocumentRoot "/var/www/current"
ServerName gjtest.no
<Directory "/var/www/current" >
AllowOverride All
Allow from all
Require all granted
</Directory>
</VirtualHost>
and added gjtest.no to /etc/hosts file like 127.0.0.1 gjtest.no
But whenever I tried the gjtest.no URL in the browser I get the following error
Object not found! The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404 localhost Apache/2.4.25 (Unix) OpenSSL/1.0.2j PHP/5.6.30
mod_perl/2.0.8-dev Perl/v5.16.3**
The url is automatically changed to localhost
Related
I am desperate for help. I am new to mac and Laravel. I have just installed a fresh project and Laravel and i am trying to create the virtual host, my code:
httpd-vhosts.conf
<VirtualHost *:80>
DocumentRoot “/Applications/XAMPP/htdocs”
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot “/Applications/XAMPP/htdocs/learninghub/public”
ServerName learninghub.local
</VirtualHost>
hosts
##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting. Do not change this entry.
##
127.0.0.1 localhost
127.0.0.1 learninghub.local
Getting the following error -
Object not found! The requested URL was not found on this server. If
you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404 localhost Apache/2.4.41 (Unix) OpenSSL/1.1.1c PHP/7.3.9
mod_perl/2.0.8-dev Perl/v5.16.3
Any help is greatly appreciated.
Referring to homebrew
Error: Failure while executing; git clone
https://github.com/Homebrew/homebrew-core
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core exited with
128.
Try with this:
<VirtualHost *:80>
DocumentRoot "/Applications/XAMPP/htdocs/learninghub/public"
ServerName learninghub.local
ServerAlias *.learninghub.local
<Directory "/Applications/XAMPP/htdocs/learninghub/public">
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
If you are on a Mac, I would highly suggest using Laravel Valet instead. Its a very compact development environment that uses Nginx and dnsmasq to serve your local projects with pretty URLs (*.test).
With Valet, you really don't have to fiddle with virtual hosts or edit your hosts file. You just add the directory where your projects live to Valet, and it will automagically serve them.
I have a project c:/xampp/testadmin(laravel).I have created a virtual host for it.
<VirtualHost *:8080>
DocumentRoot "C:/xampp/htdocs/testadmin/public"
SetEnv APPLICATION_ENV "development"
ServerName mywebsitename.com
ServerAlias mywebsitename.com
<Directory C:/xampp/htdocs/testadmin/public>
DirectoryIndex index.php
AllowOverride All
Require all granted
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
Actauly my mywebsitename.com
is a sub domain url. Now everything is okay and project is up.but problem is that when i hit mywebsitename.com/storage/app i got an error
Object not found!
The requested URL was not found on this server. If you entered the
URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
mywebsitename.com
Apache/2.4.29 (Win32) OpenSSL/1.1.0g PHP/7.2.0
but when i hit localhost:8080/testadmin/storage/app it's working.and now my App-URL is mywebsitename.com.how can i solve this isuue?
Any help would be appreciated.
i use xampp on mac os and i want to add virtual host on it
i use this code on apaceh config
<VirtualHost 127.0.0.1:80>
ServerName mvcproject.local
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/mvcproject/public"
</VirtualHost>
<Directory "/Applications/XAMPP/xamppfiles/htdocs/mvcproject/public">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
and change my host like this
127.0.0.1 localhost
255.255.255.255 broadcasthost
::1 localhost
127.0.0.1 Masouds-MacBook-Pro.local # added by Apache Friends XAMPP
127.0.0.1 mvcproject.local
but i have this error
Server error!
The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.
If you think this is a server error, please contact the webmaster.
Error 500
mvcproject.local
Apache/2.4.33 (Unix) OpenSSL/1.0.2o PHP/7.2.5 mod_perl/2.0.8-dev Perl/v5.16.3
How can i solve this problem?!
thanks.!
These are some point to help in create virtual host on mac
/Applications/XAMPP/xamppfiles/etc/httpd.conf in this file uncomment the
include line
Virtual hosts
Include /Applications/XAMPP/etc/extra/httpd-vhosts.conf
Add your site into vhosts file
/Applications/XAMPP/xamppfiles/etc/extra/httpd-vhosts.conf
My custom host
<VirtualHost *:80>
ServerName mysite.local
DocumentRoot "/Users/yourusername/path/to/your/site"
<Directory "/Users/yourusername/path/to/your/site">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
ErrorLog "logs/mysite.local-error_log"
</VirtualHost>
Edit your host file
sudo nano /etc/hosts
#Add the following line
127.0.0.1 mysite.local
Restart your XAMPP
I am writing one web application using php, But I don't know how to access my website directly from localhost.
I have configured VirtualHost in apache but still not working,
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/top10"
ServerName top10.com
<Directory "C:/wamp/www/top10" >
allow from all
order allow,deny
AllowOverride all
</Directory>
DirectoryIndex index.html index.php
</VirtualHost>
I have also add the same ServerName entry in hosts file
When I try to access I am getting following error
Not Found
The requested URL / was not found on this server.
Apache/2.4.9 (Win32) PHP/5.5.12 Server at top10.com Port 80
I want to access my website as http://top10.com instead of http://localhost/top10.
Could you please help me for this
Open hosts file ( AS Administrator ) in C:/Windows/System32/drivers/etc/ and add the following line ( Don't delete anything )
127.0.0.1 myWebsite.local
change myWebsite.local as per your name requirements
I am new to squirrelmail. I am trying to configure a mail server on a linux machine which I installed apache, php, and dovecot.
I installed squirrelmail from the source code in /var/www/webmail/
I configured a virtual host:
<VirtualHost *:80>
ServerName webmail.my.domain.com
ServerAlias webmail
DocumentRoot /var/www/webmail
<Directory "/var/www/webmail">
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
I set the Domain under "Server Settings" in the config file to webmail.my.domain.com.
when I try to do a configtest.php in browser: webmail.my.domain.com/src/configtest.php
I get this error: 404 Not Found
The requested URL /src/configtest.php was not found on this server.
I am not sure how to get past this error. Any help would be appreciated.
Thanks.