403 error for xampp virtual host after server restart - php

I am trying to setup a prod. wordpress site on localhost, my first step is to setup a virtual host. following the step to setup virtual host worked but once I shut down xampp and restarted it, I started to get the 403 error
My "httpd-vhosts.conf" file configs are:
In "httpd.conf" file I have uncommented httpd-vhosts.conf and also set user group accordingly
I also made changes to "httpd-xampp.conf"
changing "require local" > "require all granted"
After multiple attempts I am still unable to setup virtual host and keep getting the following error
My access log shows the following log:
127.0.0.1 - - [08/Feb/2023:12:14:47 +0530] "GET / HTTP/1.1" 403 1038
127.0.0.1 - - [08/Feb/2023:12:14:47 +0530] "GET /favicon.ico HTTP/1.1" 403 1024
127.0.0.1 - - [08/Feb/2023:12:15:07 +0530] "-" 408 -
My error log tell me the following:
[Wed Feb 08 12:14:47.653295 2023] [core:crit] [pid 88973] (1)Operation not permitted: [client 127.0.0.1:50100] AH00529: /Users/yapsody/Desktop/wordpress/.htaccess pcfg_openfile: unable to check htaccess file, ensure it is readable and that '/Users/yapsody/Desktop/wordpress/' is executable, referer: http://www.yapsody.com/
Hoping someone can help me!
Update:
I use a macbook pro intel i5

here are steps for doing what you asked:
1- Install xampp on some hard drive - default is C:
2- Go to C:\xampp\htdocs\
3- Add your project here. (for example, C:\xampp\htdocs\newfolder/index.html)
4- Open a web browser(Chrome, Safari, etc.)
5- Type in address bar:
http://localhost/newfolder
If you want to run as a site, do this:
1- Go to this file
C:\xampp\apache\conf\extra\httpd-vhosts.conf
At last paragraph, copy last section, paste it twice,
and change it like this:
<VirtualHost *:80>
DocumentRoot "C:/xampp/"
ServerName localhost
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/newfolder/index.html"
ServerName sample.com
</VirtualHost>
then in this file:
C:\Windows\System32\drivers\etc\hosts
do this:
127.0.0.1 localhost
127.0.0.1 sample.com
Please don't change commenting, just copy them and then make changes to your copies.

Related

Laravel - created virtual host, however website will not connect to localhost

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.

Error 404 on localhost with wampserver

I've been using wamp for 2 weeks at my work without any problem, but now I've some issues :
localhost/phpmyadmin is working well, but
localhost/ and 127.0.0.1 gives me a 404 error :
Not Found The requested URL / was not found on this server.
I already tested the port 80 and it's used by Apache.
I have virtual hosts that works well but I can't create a new one anymore, it won't work, I don't know why.
I've searched a lot on internet but all I can find is solution that just does not work for me so if you could help me, that would be fantastic.
EDIT : I just changed my httpd-vhosts.conf, I had a mistake in my new vhosts, so now they work well, but I still have an error 404 on localhost/.
EDIT : Thank you RiggsFolly for the help, I needed to had localhost in my httpd-vhosts.conf
Ok, this sounds like the browser is trying to use the IPV6 network but you have not entered the IPV6 loopback address into the hosts file
Amend your hosts file to be
127.0.0.1 localhost
127.0.0.1 other.dev
127.0.0.1 other2.dev
::1 localhost
::1 other.dev
::1 other2.dev
The ::1 is the IPV6 loopback address just as 127.0.0.1 is the IPV4 loopback address.
You say you have Virtual Hosts setup, did you also define one, the first one for localhost. Once a Virtual Host is defined the default in httpd.conf for localhost is ignored.
So add this to the top of httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
DocumentRoot c:/wamp/www
<Directory "c:/wamp/www/">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require local
</Directory>
</VirtualHost>
Change c: to whatever drive you installed WAMPServer onto.

Could we create Virtual host for modules in Zend framework1.11 and Wamp server

First of all thanks for read my question:
I have created a module in Zend framework1.11
Module name = Client
Now as per our requirement we need to create virtual host on wamp server.
a) http://client.com
Following is the settings, which i have done in the C:\wamp\bin\apache\Apache2.4.4\conf\extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerAdmin client.com
DocumentRoot "C:/wamp/www/loyality/application/modules/client/"
ServerName client.com
ServerAlias www.client.com
ErrorLog "logs/dummy-host.example.com-error.log"
CustomLog "logs/dummy-host.example.com-access.log" common
</VirtualHost>
After that enable the window host file under C:\Windows\System32\drivers\etc/hosts
But i am getting error 500 Internal Server Error
In the error log i have found following error:
[Fri Jan 02 12:47:12.154296 2015] [core:error] [pid 4324:tid 1600] [client 127.0.0.1:50923] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
Please suggest, how can i made Virtual host for modules in zend framework
We can resolve this issue with following settings:
Here i am using Wamp server, Zend framework.
Step 1: First we need to enable Include conf/extra/httpd-vhosts.conf line in the apache file httpd.conf
For example:
# Virtual hosts
Include conf/extra/httpd-vhosts.conf
Step 2: We need to define Virtual host in the httpd-vhosts.conf file which is present in the bin\apache\Apache2.4.4\conf\extra\httpd-vhosts.conf
For example: We can define virtual host like following code.
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName pizzahut.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName dominos.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot "C:/wamp/www/loyality/public/"
ServerName client.com
</VirtualHost>
Step3: Now we need to make mappings of IP address to different host names
For example :
127.0.0.1 localhost
127.0.0.1 pizzahut.com
127.0.0.1 www.pizzahut.com
127.0.0.1 localhost
127.0.0.1 dominos.com
127.0.0.1 www.dominos.com
127.0.0.1 localhost
127.0.0.1 client.com
127.0.0.1 www.client.com
Step 4: Define or Add constant for default module in the index.php file which is present in the public folder.
For example:
defined('DEFAULT_MODULE') || define('DEFAULT_MODULE', "dominos");
Step 5: Enable Default module in the application.ini file using following code.
resources.frontController.prefixDefaultModule = true
resources.frontController.defaultModule = DEFAULT_MODULE
With these above steps, i found solution for this question.
Now Our default module is dominos and when i am running http://www.dominos.com then my dominos module pointing.
Thanks,
Sunny Patial.

Installing Bonfire for Codeigniter Server and Install link issues

I'm trying to install Bonfire for Codeigniter and I'm having some issues. I first tried downloading the zip, unziping it and placing it in MAMP and navigating to it through localhost. The welcome page came up but when I clicked on the "install" button, it displayed a "URL Not Found" page. Quite annoying since I'm under the gun.
I saw on youtube, that the dev team shows the install by cloning the repo on Github so I tried that next. Now when I load that in my localhost, I get a welcome page without an install button, an error saying my "htaccess" should be renamed ".htaccess" (although when I looked at the file it looked fine to me) but more worryingly is the next error:
"Oops!
Your Web Root should be set to the public folder,but it's not. It's pointing to the Bonfire Root folder.
See below how your site should be set up on Apache:
<VirtualHost *:80>
DocumentRoot "[...]/htdocs/Bonfire_Root/public"
ServerName Bonfire.Root
ServerAlias Bonfire.Root.local
</VirtualHost>"
I'm a really junior programmer and I'm just trying to get this sorted out quickly because of a project I'm on that I need to turn around quickly. I'm sure this is probably something simple so does anyone know what I can do to fix this so it will work and I can begin developing with Bonfire? Thanks in advance!
EDIT:
When I followed the instructions about adding my project name to the URL, I moved on to a blank page, Chrome initiated a download of a textfile called install which contains this:
J
5.5.34B:;Z1&hZˇ˜Äj*/Knh#G"o/9mysql_native_password!ˇÑ#08S01Got packets out of order
I'm not sure what to do with this. Any ideas?
I've tried:
http://localhost/Bonfire_Root/public/
http://localhost/Bonfire_Root/public/index.php
http://192.1xx.xxx.xxx/Bonfire_Root/public/index.php
Each time it just downloads the textfile with the same text in it. :/
here's my work around (I'm on linux btw):
1) make sure mod_rewrite is enable on your apache setup.
2) add <VirtualHost *:80>
DocumentRoot "/path/to/your/htdocs/bonfire/public"
ServerName bonfire.dev
ServerAlias bonfire.dev
<Directory "/path/to/your/htdocs/bonfire/public/">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
3) edit your /etc/hosts file, add this line 127.0.0.1 Bonfire.Root
4) restart your apache
5) access bonfire on http://bonfire.dev, instead of http://localhost/Bonfire_Root/public
hope it helps
I would suggest no need to use htaccess if you are working on local environment.about your error when you click on install button after that in your url put your project folder name like 'host:port/yourprojectname/public/index.php' . would redirect to you next page to get installation process done.
I had same problem but in windows yes working on mac and windows quite similar. When i clicked on install it goes to http//localhost/public which is not correct url so i have change by adding my project name after localhost http//localhost/project/public/index.php.
Major difference between mac and window while using PHP is s you have to use ip address in place of localhost.
Assuming you are installing bonfire in windows D:\ drive and path of you index.php is "D:/xampp/htdocs/bonfire" please follow below steps:
1. Edit your `D:/xampp/htdocs/bonfire/index.php` file
<VirtualHost 127.0.0.1:80>
DocumentRoot "D:/xampp/htdocs/bonfire"
ServerName 127.0.0.1
ServerAlias bonfire.dev
</VirtualHost>
Open your httpd.conf file (in case of xampp path will be D:\xampp\apache\conf\httpd.conf) and add this in the end of your file.
NameVirtualHost localhost
<VirtualHost localhost>
DocumentRoot D:/xampp/htdocs/bonfire
ServerName localhost
<VirtualHost>
#####
## myproject.dev
## DOMAIN of myproject
#####
NameVirtualHost bonfire.dev
<VirtualHost bonfire.dev>
DocumentRoot D:/xampp/htdocs/bonfire/public
ServerName bonfire.dev
</VirtualHost>
note that bonfire.dev is a naming convention i have given to my website and mentioned it inside my C:\Windows\System32\drivers\etc\hosts file so as convenient to you, choose any name suitable to you
Edit C:\Windows\System32\drivers\etc\hosts file.
Add below lines in hosts file.
127.0.0.1 localhost
::1 localhost
127.0.0.1 bonfire.dev
4. Restart Apache and now open your web page `http://bonfire.dev/`
This solution works 100%, I have been fighting up with same issue and now finally its fixed. Just try it and get back to me in case of any issue.
launches the PHP server into the directory of your project exempel
www / (project) / public / php -S localhost: (port)

OS X (10.9.1) localhost 403 Forbidden you don't have permission to access / on this server

I have just started using laravel and a mac to develop websites. I have gone through the setup and tried following a phpacademy tutorial.
My problem is that when i try and access the localhost, as default i get the index page where all my folders are stored and when i enter my direct path e.g. laravelpractice.local in the web browser i get the error that i mentioned in the title.
i have edited the /etc/apache2/httpd.conf and the /etc/hosts to create a virtual host and create a custom url respectively and the spelling seems to be fine.
/etc/hosts file open. You must be the owner of the file.
127.0.0.1 localhost.localdomain localhost
after add
127.0.0.1 laravelpractice.local
000-default.config file save. After /etc/apache2/sites-enabled/000-default.config file open. You must be the owner of the file. Add to the bottom
<VirtualHost *:80>
DocumentRoot "/var/www/laravelpractice/public/"
ServerName laravelpractice.local
</VirtualHost>
Apache restart with terminal:
sudo service apache2 restart
Open browser and url : laravelpractice.local

Categories