I got an minor Problem with Gitlab.
I setup the complete system according to the manual from gitlab.
I used an nginx xserver with theire nginx config file.
If I access any none php file it works.
But as soon as I open one of these files I get ofllowing line in the server log:
2013/12/04 14:24:46 [error] 28622#0: *10 access forbidden by rule, client: aaa.bbb.ccc.ddd, server: xxx.xxxx.xxx, request: "GET /dev/worker/blob/master/call.php HTTP/1.1", host: "xxx.xxxx.xxx", referrer: "https://xxx.xxxx.xxx/dev/worker/tree/master"
I'm accessing the server over https.
Internaly it runs on http
I also have installed php-fpm but it does not run on the current host.
Please help
Chris
The Problem was the nginx configuration itself.
I have an ispconfig panel running that creates the nginx site files.
Problem was, it creates an entry that disallows php files to everyone.
It makes sence for php based sites, as the php files can only be accessed through the fpm process.
But it makes no sence for a git server
^^
thanks for the patience
Related
I have a Centos Stream 9 server running Apache 2. I think it is mostly well configured since I never get error messages in my CLI when doing the sudo systemctl restart httpd.service command. But I'm getting a 503 error message trying to access my server with the IP or the domain name in a browser.
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Unavailable</title>
</head><body>
<h1>Service Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
</body></html>
The thing is I have Laravel installed there and I usually run composer to do the updates and I also pull from git. Those commands are ran by my default user centos:centos, while my web server is ran by apache:apache. I wanted to switch my webserver to the same user because I was getting write permission errors when doing the composer install command. The /storage and /bootstrap directories were owned by the apache user.
So, I still don't know if this is something that has to do with my Laravel install, or the server configuration. I was thinking it was a firewall thing, but I'm guessing there must be a way to run my httpd service with my centos user to fix this issue.
Looking into the Error log I found that it was actually getting a message about FastCGI.
(13)Permission denied: AH02454: FCGI: attempt to connect to Unix domain socket /run/php-fpm/www.sock (*) failed
Doing some research into the error I understood that it had to do with the configuration of php-fpm
The following is a link to a post that contains good information to solve the problem althought the approved answer is not the correct answer for the problem and I had to dig a little bit into configuring the php-fpm module:
FPM with apache2 not working (Permission denied)
Lastly, I will share a link to the PHP-FPM installation instructions that also gave me an idea on how to fix it, but not exactly worked for my problem:
Configure Apache with PHP-FPM
If possible to you change current configuration?
if yes...
PHP-FPM is able to work using socket file or tcp socket, so you can:
1.Change to TCP configuration (/etc/php-fpm.d/www.conf by default)
listen = 127.0.0.1:9000
listen.allowed_clients = 127.0.0.1
2.Change your apache configuration
From:
SetHandler "proxy:unix:/run/php-fpm/www.sock|fcgi://localhost"
To:
SetHandler "proxy:fcgi://127.0.0.1:9000"
3.Restart both services.
Have spent over a day trying to get PhpStorm to debug a Drupal site inside a Vagrant virtual machine running Xdebug and I feel I'm close - but just not quite there yet.
Currently, in PhpStorm when debugging I have an error:
Waiting for incoming connection with ide key 'PHPSTORM'
In the Xdebug log in the VM (at /tmp/xdebug.log)
[2094] I: Checking remote connect back address.
[2094] I: Checking header 'HTTP_X_FORWARDED_FOR'.
[2094] I: Checking header 'REMOTE_ADDR'.
[2094] I: Remote address found, connecting to 192.168.88.1:9000.
[2161] E: Time-out connecting to client (Waited: 200 ms). :-(
[2161] Log closed at 2020-12-15 04:25:32
I tried setting up the Zero-configuration debugging without any luck.
For the debugging configuration, I have a PHP Remote Debug that validates correctly although it always defaults to the 'Local Web Server or Shared Folder' rather than the 'Remote Web Server' option.
When I started the project I set it up as a local web server option and I'm worried that I haven't changed the correct settings to now make this a remote web server. The connection type for the deployment is now 'Local or mounted folder' but originally this was 'In-place'.
Under Languages & Frameworks --> PHP --> Servers, I set this up on port 80, using Xdebug and without path mappings. I tried changing the port etc but then it doesn't validate so I'm confident that the server settings are correct and that PhpStorm is talking to the virtual machine correctly.
I changed the /etc/php/7.4/cli/php.ini file but phpinfo() says the configuration is coming from /etc/php/7.4/fpm/php.ini. The changes I made in the php.ini file are active though. phpinfo() is showing:
xdebug.idekey: PHPSTORM
xdebug.remote_host: 10.0.2.2
xdebug.remote_port: 9000
xdebug.remote_autostart: Off
xdebug.remote_connect_back: On
Really at a loss now as to what to try next. It is incredibly frustrating so hope someone can shed some light.
EDIT --- As per comment here is the screenshots of the setup:
Deployment: Local or mounted folder
PHP settings
The server setup
Debug settings
Validate the debugger from the remote server
Run Chrome with the debug addon running
The error message
The Run debug configuration settings
Start of the phpinfo with the config file showing where the xdebug settings need to be edited.
The Xdebug settings of phpinfo()
Some of the tests as per the comments:
After logging in to 'vagrant SSH' it shows the IP address to be used (10.0.2.2). The local computer is also IP 10.1.1.150 a telnet test of both of these works.
A 'sudo nano' of the Xdebug ini file
NOTE: Changing the remote connect back to 0 fixed the connection:
xdebug.remote_connect_back=0
And then the path mapping needed to be turned on in the Server settings and then everything was working correctly.
Big thanks to LazyOne for his helpful and thorough comments. :)
1) Check if there are separate php.ini files used by web server, -- you need to edit the right php.ini file.
Run phpinfo() and check to see if there is an ini file for Xdebug. In my case this was at /etc/php/7.4/fpm/conf.d/20-xdebug.ini
2) What's your Xdebug version?
Version 2 and 3 of Xdebug have slightly different parameters. In my case I was running Xdebug 2.9.5
3) What is the IP address of your Host OS as seen from the inside the VM? That's where Xdebug should connect (as it's Xdebug that connects to IDE and NOT other way around).
When you first log in to the SSH there will be an IP address shown. This is what the IP should be for Xdebug. In my example, this was 10.0.2.2
4) xdebug.remote_connect_back: On -- try set it off and ensure that you have correct xdebug.remote_host (as Xdebug v2 may not fallback to remote_host value when autodetected IP fails.
This fixed my connection!
sudo nano /etc/php/7.4/fpm/conf.d/20-xdebug.ini
Then change:
xdebug.remote_connect_back=1
To:
xdebug.remote_connect_back=0
Save, and then restart the server.
Test the connection again. After this step I had a connection between the host and remote server but I also had to turn on path mapping in PhpStorm to get the debugger working 100%.
5) Ensure that PhpStorm is the one that listens on Xdebug port when "phone handle" icon is enabled (use netstat or alike to confirm) and is allowed in firewall.
6) If you know the correct IP and sure that PhpStorm is listening -- you can just use telnet from inside the VM and try to connect to IDE on Xdebug port -- if connected then IP, port and firewall is most likely set up correctly.
Even with the error messages, the telnet check was working. So it pointed to the issue being with the Xdebug setup rather than the handshaking between the host and remote server.
Thanks to LazyOne's comments for finding the answer and for presenting a great workflow to help identify the problem.
I was experiencing something very similar to what you described.
I was able to start a debug session from the xdebug cli tool (dbgpClient) which proved to me that it was an issue with phpStorm.
My project is using a legacy version of xdebug. (2.2.7)
Downgrading to phpStorm 2020.2.4 resolved my issue.
(It's one-click in the jetbrains toolbox to downgrade)
Thanks for the answers in this issue. It took me half a day to find out that xdebug 2.2.7 with php5.3.10 doesn't work on Phpstorm 2020.3. So I downgraded to 2020.2.4 and it works again.
I am trying to understand why my JHipster app is not working when i deploy it to Heroku (It does locally) so my first thought was going to the logs. However when i type $ heroku logs i receive back the following error.
571 borgesan:~/bitbucket/eureka $ heroku logs -n 200
▸ Logs eventsource failed with: 400 Bad Request
What could be causing this error?
I encounter exactly the same log message when deploying a kotlin app that works locally with 'heroku local web'. The web app is based on a jetty server running on port 5000 (same port as in the kotlin-getting-started example, but different web server).
In parallel, all requests to server are refused with 503 Service available
Is there a parameter to set somewhere in the heroku configuration or procfile to declare internal port 5000 (to allow mapping between outside port 80 or 443 to internal port 5000)?
Is it a problem due to CORS or so ? In other words, shall the application accept specific fields of request header ?
other thing to take care of ?
Thanks
I am using Laravel. In XAMPP's htdocs folder my laravel root folder name is sh.
I ran the following code
php artisan serve
and found that
Laravel development server started: <http://127.0.0.1:8000>
In Browser Address Bar I wrote
localhost:8000
now
waiting for localhost...
never ends.
I ran this code
C:\>netstat -a
in a long list I found that
TCP 127.0.0.1:8000 ommited-PC:0 LISTENING
TCP 127.0.0.1:8000 ommited-PC:49674 ESTABLISHED
In Browser's address bar I wrote
http://localhost/sh/public/
the site opens correctly.
This is my observation. I don't know why localhost waits for ever and what should I do.
Solved
This was because of Avast Antivirus. By mistake Avast treated server.php file as a threat. I make an exception following this link
https://support.avast.com/en-ww/article/Antivirus-scan-exclusions
then the problem has been solved.
Try to run in different port. Check this thread for further detail... Click here
I have started my app locally and reach it fine on http://localhost:3000
But when trying to access it throuhg the cypress tool I get 502 bad gateway. Anyone knows why this differ from it working just fine in Chrome to access it?
Faced the same issue when running Angular app in localhost. App was running in chrome but not in cypress tool giving 502 bad gateway error. I builded the angular app by ng-build command and served using command http-server -p 4200 -c-1 dist/your_poject_name. When running http-server command, got as below:
Starting up http-server, serving dist
Available on:
http://10.132.14.98:4200
http://127.0.0.1:4200
Use the url http://10.132.14.98:4200 in cy.visit and now bad gateway error does not come. The problem is with using 127.0.0.1 or localhost in the url. Anything other than localhost and 127.0.0.1 works. Hope this information helps.