Check GitLab API access: FAILED. code: 404 - ruby

what to do to fix this?
Thank you!
sudo -u git bin/check
Check GitLab API access: FAILED. code: 404

A simple search - https://github.com/gitlabhq/gitlab-shell/issues/37 reveals that URL set in config.yml for gitlab-shell is incorrect and causes 404 error.

If you still get 404, review the vhost config. Next you can find an example from a Mac OS X apache machine:
<VirtualHost *:443>
ServerName domain.com
DocumentRoot "/Users/git/gitlab/public"
CustomLog /var/log/apache2/access_log combinedvhost
ErrorLog /var/log/apache2/error_log
<IfModule mod_ssl.c>
SSLEngine On
SSLProxyEngine On
SSLCertificateFile "/etc/certificates/domain.com.cert.pem"
SSLCertificateKeyFile "/etc/certificates/domain.com.key.pem"
SSLCertificateChainFile "/etc/certificates/domain.com.chain.pem"
</IfModule>
ProxyPass /uploads !
ProxyRequests Off
ProxyPreserveHost On
ProxyPass / http://127.0.0.1:8080/
<Location />
ProxyPassReverse /
Order deny,allow
Allow from all
</Location>
</VirtualHost>
Cheers,

Make sure in /home/git/gitlab-shell/config.yml gitlab_url: "hostname.example.com" is set to the correct FQDN of the gitlab server. Sometimes it helps if you add the hostname information in /etc/hosts too.
Most of the time when I see this error it's due to a DNS problem.

I was having the same issue and it in the end it ended up being an issue with my virtualhosts setup in apache.

Related

Laravel routes behind reverse proxy generating wrong url

Let me explain my situation. I have a server that host five sites in www/html folder using the Apache 2 server but all of them run on PHP 5.4. I was asked to upload a system on this server, but it uses PHP 7+. The system is dockerized, so it contains their own container running php 7. So, I was thinking in use a reverse proxy to redirect the requests to docker container. Ok, I managed to do it. My container is running and I can access the system in production. But the system is broken, the static files and the routes are not being well formed.
This image shows the error in console. I just hid the IPs.
https://i.stack.imgur.com/5dvVe.png
This my Apache configuration in sites-available folder. I just added the Location tag to redirect for my container.
<VirtualHost *:80>
ServerAdmin webmaster#localhost
DocumentRoot /var/www/html
LimitRequestLine 16382
LimitRequestFieldSize 16382
Timeout 12000
AddDefaultCharset ISO-8859-1
SetEnv no-gzip 1
<Directory /var/www/html>
Options -Indexes +FollowSymLinks +MultiViews
AllowOverride All
Require all granted
</Directory>
<Location "/educar">
ProxyPreserveHost On
ProxyPass "http://localhost:8001/educar"
ProxyPassReverse "http://localhost:8001/educar"
</Location>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
This is my first question here, so I just apologized for any mistake.

Oracle Apex pretty URL

i need help for a problem.
Before someone complain. I have post the same question in another forum but i didn't get any useful help there.
https://community.oracle.com/tech/developers/discussion/4497783
I have seen there are a lot of things if i search by google but i am a total newbie so i hope that someone could help me.
I have a dedicated Server with apex running. I have point a domain to my apex application, so far , so good.
Now i have the url like following www.mydomain.com/apex/workspace_name/r/application
What i want to do is, that the user don't see the part "/apex/workspace_name/r" when he is working with the application.
Is there a relative easy way to do that? Something like .htaccess?
Many thanks and regards,
Andreas
Using an Apache HTTPD web server to reverse proxy your APEX connections, you can use the ProxyPass and ProxyPassReverse directives of the mod_proxy module to alter URL paths that the user sees:
ProxyPass /r /apex/workspace_name/r
ProxyPassReverse /r /apex/workspace_name/r
See the Apache documentation for more details: https://httpd.apache.org/docs/2.4/mod/mod_proxy.html#proxypass
In my case, I used the mod_proxy_ajp module to communicate with the cluster of Tomcat application servers running ORDS, as follows:
#######################################################
#
# APEX Virtual Host
#
#######################################################
<VirtualHost 192.168.1.101:443>
# General setup for the virtual host
DocumentRoot "/var/www/html"
ServerName apps.mydomain.com
ServerAdmin root#localhost
ErrorLog "/etc/httpd/logs/apex.ssl_error.log"
# Redirect root URL to a default application
RedirectMatch ^/$ /ords/f?p=200
... other directives here ...
<IfModule mod_proxy_ajp.c>
ProxyRequests Off
ProxyPreserveHost On
<Proxy balancer://ords_balancer>
BalancerMember ajp://appserver1:8009 route=server1
BalancerMember ajp://appserver2:8009 route=server2
</Proxy>
# Redirect /ords to the load balancer
ProxyPass /ords balancer://ords_balancer/ords stickysession=JSESSIONID|jsessionid
ProxyPassReverse /ords balancer://ords_balancer/ords
ProxyPassReverseCookiePath /ords /
# Redirect /i to the load balancer
ProxyPass /i balancer://ords_balancer/i stickysession=JSESSIONID|jsessionid
ProxyPassReverse /i balancer://ords_balancer/i
<Proxy *>
Order deny,allow
Deny from none
Allow from localhost
</Proxy>
<Location /balancer-manager>
SetHandler balancer-manager
</Location>
</IfModule>
</VirtualHost>

Not propperly routing in reversed proxy Laravel App

I have configurated an Apache Server which uses reverse proxy to show a web app developed in laravel and mounted in another apache web server. Let's say that the domain is myapp.app
Which works properly, but when I click to a subdomain, let's say myapp.app/register the browser returns myapp.appregister/.
At the moment I've configurated my webserver as it follows:
<IfModule mod_ssl.c>
<VirtualHost *:443>
SSLEngine On
ServerName myapp.app
<Proxy *>
Order deny,allow
Allow from all
</Proxy>
<Location "/">
RequestHeader set X-Forwarded-Proto https
RequestHeader set X-Forwarded-Ssl on
RequestHeader set X-Url-Scheme https
</Location>
ProxyPreserveHost on
ProxyPass / http://172.31.0.234/
ProxyPassReverse / http://172.31.0.234/
Include /etc/letsencrypt/options-ssl-apache.conf
ServerAlias www.redes-erdica.tech
SSLCertificateFile /***.pem
SSLCertificateKeyFile /***.pem
</VirtualHost>
</IfModule>
<IfModule mod_ssl.c>
<VirtualHost *:80>
ServerName myapp.app
Redirect permanent / https://myapp.app/
</VirtualHost>
</IfModule>
And the config file for the inner apache server has no other configurations besides the location of the laravel Project. Some curious event that happens is that if I type manually myapp.app/register it sends me where it should be, so why the browser sends me in a wrong direct when I click in the register button?
In addition, the app in localserver works properly.
You need to modify the main configuration file located on the /etc/apache2 folder, you need to change the value of the section AllowOveride that points to the folder on which your aplication lives and change it like this:
<Directory [your_app_folder]
Options ...
AllowOverride All
Require ...
</Directory>

Laravel api on apache2 ubuntu server 404 not found

I have a locally created laravel RESTFUL API and I deployed it on my ec2 ubuntu server using git.
I've set it like my main website.. /var/www/api.myapp.com/public_html/myapp-be and for its config I have this /etc/apache2/sites-available/api.myapp.com.conf.
Almost all blogs and tutorials that I found about deploying laravel on apache2 ubuntu server were almost the same and I've followed them all. However, when I test my API on postman with https://api.myapp.com/api/somefunctionhere it says 404 not found, The requested URL was not found on this server. Apache/2.4.29 (Ubuntu) Server at api.myapp.com port 443.
But when I test my local api on postman, it works fine, thus, I confirm that nothing is wrong with my laravel.
My config looks like this
<VirtualHost *:80>
<Directory /var/www/api.myapp.com/public_html/myapp-be/public/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
Require all granted
</Directory>
ServerAdmin developer#myapp.com
ServerName api.myapp.com
Redirect permanent / https://api.myapp.com/
ServerAlias api.myapp.com
DocumentRoot /var/www/api.myapp.com/public_html/myapp-be/public
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/error.log combined
RewriteEngine on
RewriteCond %{SERVER_NAME} =api.myapp.com [OR]
RewriteCond %{SERVER_NAME} =api.myapp.com
RewriteRule ^ https://${SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
<VirtualHost *:443>
<Directory /var/www/api.myapp.com/public_html/myapp-be/public/>
AllowOverride All
</Directory>
ServerName api.myapp.com
DocumentRoot /var/www/api.myapp.com/public_html/myapp-be/public
</VirtualHost>
Is there a spot that I missed here? Obviously I missed a spot but I've been looking for it for almost 3hours already and still wont work.
Any idea guys? Thanks!
UPDATE: I tried adding /public to the prefix and it worked, I don't even know why it worked - https://api.myapp.com/public/api/somefunctionhere

Apache HTTPS to HTTPS Redirection

We have a client server hosting our web application using Apache 2.2 & Tomcat 6 in RHEL. I have setup apache re-write rule for http to https redirection and it works fine. We have two DNS names that are used to access the same application. Test1.com and Test2.com. I want all the users trying to access http:// test1.com or https:// test1.com to https:// test2.com. As mentioned, http:// test1.com to https:// test2.com redirection is working fine. I am not able to implement https://test1.com to https://test2.com.
I have tried Virtual Hosts, ServerAlias, NameVirtualHost, but nothing works. Any suggestions if we can handles this via re-write would help. Any other pointers that might lead to the resolution of this issue will be appreciated.
Thanks
I solved this issue with redirect, but I had to setup virtual host for https redirect with all necessary ssl settings.
<VirtualHost *:80>
ServerName test1.com
Redirect "/" "https://test2.com/"
</VirtualHost>
<VirtualHost *:443>
ServerName test1.com
Redirect "/" "https://test2.com/"
SSLEngine on
# SSLProxyEngine On
SSLCertificateFile /path/site.crt
SSLCertificateKeyFile /path/site.key
SSLCertificateChainFile /path/DigiCertCA.crt
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
</VirtualHost>
<VirtualHost *:443>
ServerName test2.com
...
SSLEngine on
# SSLProxyEngine On
SSLCertificateFile /path/site.crt
SSLCertificateKeyFile /path/site.key
SSLCertificateChainFile /path/DigiCertCA.crt
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
</VirtualHost>
Try the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} test1.com$
RewriteRule ^(.*)$ https://test2.com$1 [L,NC,R=301]
If you have a <VirualHost> for both :80 and :443, this redirect should go in both configurations.
I had site1 with https (certificate) and site2 with http (without certificate), both on the same IP (virtual hosts.
Then I noteiced that site2 was getting incorrectly indexed by Google for https, using site1's content.
Whilst for RewriteCond listening
for port 80, the redirect needs to
sit in the .htaccess for site2,
for port 443, the redirect needs to
sit in the .htaccess for site1.
But then the discrimination no longer goes by port but by HTTP_HOST (the DNS name).
For me, site1 = shop.smartgart.com, site2 = one0.com.
I put this into site1's .htaccess:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^shop.smartgart.com$
RewriteRule ^(.*)$ https://shop.smartgart.com/$1 [R=301,L]
That is: If the HTTP_HOST being handled is not site1, then redirect to site1, using the supplied suffix ($1).
Works for me!
I solved this issue with MULTIPLE redirects, not the same as #A Kunin 's answer.
Because I use different certificates for both site, and it will report certificate error if I just redirect from httpS://test1.com to httpS://test2.com.
My solution is: httpS://test1.com --> http://test1.com --> httpS://test2.com
<VirtualHost *:80>
ServerName test1.com
Redirect "/" "https://test2.com/"
</VirtualHost>
<VirtualHost *:443>
ServerName test1.com
#### The Tricky ####
Redirect "/" "http://test2.com/"
SSLEngine on
# SSLProxyEngine On
SSLCertificateFile /path/site1.crt
SSLCertificateKeyFile /path/site1.key
SSLCertificateChainFile /path/DigiCertCA1.crt
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
</VirtualHost>
<VirtualHost *:443>
ServerName test2.com
...
SSLEngine on
# SSLProxyEngine On
SSLCertificateFile /path/site2.crt
SSLCertificateKeyFile /path/site2.key
SSLCertificateChainFile /path/DigiCertCA2.crt
SSLProtocol ALL -SSLv2 -SSLv3
SSLHonorCipherOrder on
SSLCipherSuite EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH
</VirtualHost>

Resources