Client with the currently selected authenticator does not support any combination of challenges that will satisfy the CA - security

I've been following this tutorial to add SSH Certification to my site. However at the moment this method does not work for the time-being due to a security flaw, so here is the alternate method. I'm trying to implement the alternate code-paste: sudo certbot --authenticator webroot --webroot-path <path to served directory> --installer nginx -d <domain> however am not sure what to put in <path to served directory>.
Is the "path to served directory" the nginx config? Would it look something like this: etc/nginx/sites-available/<projectname>?

You may have tried this already, but I found this to work, at least until an update is issued:
sudo certbot --authenticator standalone --installer nginx -d mydomain.com -d www.mydomain2.com --pre-hook "service nginx stop" --post-hook "service nginx start"

If you are on for debian/ubuntu and running apache this will work for you :
sudo certbot --authenticator standalone --installer apache -d <yourdomain(s)> --pre-hook "apache2ctl stop" --post-hook "apache2ctl start"
Source : Github

Related

After stopping Apache service, why can I still get Apache default page on my IP address?

I want to install Nginx, but the port 80 has been taken up by Apache2. I stop it by:
$ sudo kill -9 my-apache-pid
$ sudo service apache2 stop
$ sudo /etc/init.d/apache2 stop
[ ok ] Stopping apache2 (via systemctl): apache2.service.
and I can install Nginx. I usesudo systemctl status nginx.
It shows working well and Apache2 seems inactive. But when I enter my IP address in the browser, it still shows Apache2 hello-page. Why?
I had the same problem. To my wonder clearing history and cookies of the browser worked.
Apache and Nginx home pages located in this directory:
/var/www/html
But there is a small point, and that is that each of these two apps that were installed earlier takes up the index.html file, and when you enter the address of localhost in the browser, that file actually opens.
As a result, all you have to do is go into this directory and see what the name of Nginx home file.you must do this in your terminal:
ls -l /var/www/html
that show index.nginx-debian.html name for Nginx html file, So if you search for this address in your browser:
localhost/index.nginx-debian.html
you can see the home page of Nginx.
all you need for show Nginx home page when search localhost is change then name of those two files.
Even after you remove apache2 completely, you will still have its "default site" files sitting in /var/www/
Run the following command and refresh the page.
mv /var/www/html/index.html index.html_bkp

Trying to install GitLab on Apache on CentOS 7

I'm trying to install GitLab, but I want to install it on an Apache web server on my VPS.
I know that GitLab was built for nginx, but I honestly don't want to use it. I was wondering how I would be able to have a setup so that
mysite.com would retrieve the files (like index.html, folders with more files in them, etc.) in /var/www/html
lab.mysite.com would retrieve GitLab.
I've heard you're supposed to use a virtual host, but remember, I'm still an amateur at best with this kind of stuff, so if anyone here is kind enough to make a short step-by-step guide to do this, I'd appreciate this.
Note: Before I've been using this guide to install GitLab, however this is for Nginx, so I was wondering if I was to use this guide but then add onto it, or if I'm going about this all wrong.
By default GitLab will install nginx but usually won't add nginx to your system's service manager (service or systemctl). This makes it confusing when trying to enable Apache (Apache won't start due to default port 80 in use by nginx).
Assuming you've installed Gitlab according to the default install instructions, the Nginx service will now be managed by the gitlab-ctl service manager (which is installed when installed Gitlab).
To stop Nginx, run the following from a command line as root:
gitlab-ctl stop nginx
Now that port 80 is free, you can start Apache (don't forget to install Apache if it's not already / Instructions are for RHEL systems - modify accordingly for Ubuntu etc). Assumes you are root user:
yum install -y httpd;
systemctl start httpd;
systemctl enable httpd;
Let's edit the Gitlab config file to disable nginx and tell gitlab to use apache:
vi /etc/gitlab/gitlab.rb
Add either your domain or IP to the following:
external_url 'http://git.yourdomain.com/'
Find:
# web_server['external_users'] = []
Change to (don't forget to remove the leading '#'):
web_server['external_users'] = ['apache']
Find:
# nginx['enable'] = true
Change to:
nginx['enable'] = false
And finally we have to run a "recompile" with:
gitlab-ctl reconfigure
gitlab-ctl restart
Now the Apache config. When we installed Gitlab, it added a user group called gitlab-www. We need to allow the apache user access to that group. The following assumes you've installed apache and the user apache (48) exists:
To check which group gitlab installed itself under, you can run:
getent group
Now lets modify apache's user and add it to the gitlab-www group:
usermod apache --append --groups gitlab-www
Now we need an Apache Virtual Host to point to the gitlab install.
Add a virtual host to Apache's conf.d directory (this will create a new file):
vi /etc/httpd/conf.d/gitlab.conf
Add the following (tweak according to your needs):
<VirtualHost *:80>
ServerName git.yourdomain.com
ServerSignature Off
ProxyPreserveHost On
<Location />
Order deny,allow
Allow from all
ProxyPassReverse http://127.0.0.1:8080
ProxyPassReverse http://git.yourdomain.com/
</Location>
RewriteEngine on
RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f
RewriteRule .* http://127.0.0.1:8080%{REQUEST_URI} [P,QSA]
# needed for downloading attachments
DocumentRoot /opt/gitlab/embedded/service/gitlab-rails/public
ErrorLog /var/log/httpd/error_log
CustomLog /var/log/httpd/access_log combined env=!dontlog
</VirtualHost>
... And now restart Apache:
systemctl start httpd
You may run into issues with things like selinux - You can set things to permissive for debugging purposes.
setenforce 0
I hope this helps someone!

Trouble with Vagrant - "404 - Not Found"

I am attempting to make a LAMP box using Vagrant. I have been told that it is quite simple to use. I am completely new to networks and virtual machines and have very little experience with Linux/Ubuntu. I have currently tried following the tutorial on the official documentation page: http://docs.vagrantup.com/v2/getting-started/networking.html.
I have gotten up to the networking article in the documentation and can't seem to get it working.
Now the problem is, due to my inexperience with networking and linux based OS's I have no idea where to begin trouble shooting. I will try to give as much information I can.
I'm running the latest version of Vagrant with the latest version of Virtualbox with Windows 8.1.
As per the tutorial, my current Vagrantfile looks like this:
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network :forwarded_port, host: 4567, guest: 80
end
My bootstrap.sh file looks like this:
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -f /vagrant /var/www
fi
When I went to http://127.0.0.1:4567, it displayed an error page containing this message:
Not Found
The requested URL / was not found on this server.
===================================================
Apache/2.2.22 (Ubuntu) Server at 127.0.0.1 Port 4567
I would rather not edit any config files, unless there was an explanation, as I feel that would be a workaround. But regardless, ANY help would be appreciated. If I need to open up a port, then how do I'm at the point where I'm just considering using XAMPP.
I had same problem. I tried to restart apache from the vagrant box, I got following warning on my terminal.
vagrant#vagrant-ubuntu-trusty-64:~$ sudo service apache2 restart
* Restarting web server apache2
AH00112: Warning: DocumentRoot [/var/www/html] does not exist
AH00558: apache2: Could not reliably determine the server's fully qualified
domain name, using 10.0.2.15. Set the 'ServerName' directive globally to suppress this message
Create a DocumentRoot to fix the 404 issue by creating a directory called /var/www/html
The issue is on /etc/apache2/sites-enabled 000-default file.
Apache2 is pointing to var/www/html and vagrant example to var/www just remove de /html and make a sudo service apache2 restart.
Can you access your web server from inside your virtual machine ?
For example, try curl localhost:80
if curl is not installed, use sudo apt-get install curl on Ubuntu and try again.
Also, have you checked your apache virtual hosts ?
Is there a 000-default file in /etc/apache2/sites-available ?
There are two issues in bootstrap.sh
You need start the web service. You can also vagrant ssh to manually start it
You need make soft link, not hard link.
So the script will be updated as
$ cat bootstrap.sh
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www ]; then
rm -rf /var/www
ln -s /vagrant /var/www
fi
service apache2 start
I've experimented two working solutions:
The first is to change the file /etc/apache2/sites-enabled/000-default.conf modifing DocumentRoot in /var/www instead of /var/www/html
The second is to change the Vagrant file bootstrap.sh in the following way:
#!/usr/bin/env bash
apt-get update
apt-get install -y apache2
if ! [ -L /var/www/html ]; then
rm -rf /var/www/html
ln -fs /vagrant /var/www/html
fi
Beside that, for some reason I've had to change also the configuration of port forwarding in the Vagrantfile, adding the host_ip key, like this:
Vagrant.configure(2) do |config|
config.vm.box = "hashicorp/precise32"
config.vm.provision :shell, path: "bootstrap.sh"
config.vm.network :forwarded_port, host: 4567, guest: 80, host_ip: "127.0.0.1"
end

installations of cake php website in linux server

I've developed a website in cakephp and it is running successfully in localhost of my windows operating system.Now i need to make it run on Linus static IP server.I also need to know that what are all the softwares needed to install and implementation procedures to upload it and where to upload it.Any help would be greatly appreciate.
You have to research a bit more on the net, there's plenty of answers guiding you how to do it. Stackoverflow is more pertaining to specific coding questions. I personally prefer using amazon ec2 for uploading my cakephp applications.
There's lots of tutorials on how to set up a free tier linux server instance on ec2 all over the net. Here's a great one:
http://www.comtechies.com/2013/01/how-to-host-dynamic-php-website-on.html
Once you have your instance set up, this is what you have to do:
In apache your public folder will be /var/www/ so anything you put in there will be directly accessible to people by URL. Use putty to connect to your server.
sudo service apache2 stop
This will stop your apache server for security reasons while you upload etc.
Copy your project to /var/www/cakephp such that your webroot lies in /var/www/cakephp/app/webroot.
type the following to describe location of cakePHP
nano /var/www/cakePHP/app/webroot/index.php
Go to the line starting with define('CAKE_CORE_INCLUDE_PATH' and make it define('CAKE_CORE_INCLUDE_PATH', DS . 'var' . DS . 'www' . DS . cakephp . DS . lib') - assuming cakephp/lib is to be found in /var/www/cakephp/lib
Next, set the new document root:
sudo nano /etc/apache2/sites-available/default
and wherever you see /var/www change it to /var/www/cakephp/app/webroot.
Also, in the change allowoverride none to allowoverride all the first two times they occur from the top of the document.
To allow apache to access your files and write to cache, execute the following commands:
sudo chown www-data:www-data /var/www/myproject -R
sudo chmod 777 /var/www/myproject/tmp -R
To allow CSS to be applied properly:
sudo a2enmod rewrite
Restart apache:
sudo service apache2 start
Now everything should be working according to plan. If you have any further questions do hit me back!

Redmine RailsBaseURI

I installed Redmine with this How-To
http://www.redmine.org/projects/redmine/wiki/HowTo_Install_Redmine_using_Debian_package
ln -s /usr/share/redmine/public /var/www/redmine
chown -R www-data:www-data /var/www/redmine
echo "RailsBaseURI /redmine" > /etc/apache2/sites-available/redmine
a2ensite redmine
/etc/init.d/apache2 reload
/etc/init.d/apache2 restart
But I get following message restarting apache2.
Syntax error on line 1 of /etc/apache2/sites-enabled/redmine:
Invalid command 'RailsBaseURI', perhaps misspelled or defined by a module not included in the server configuration
Action 'configtest' failed.
The Apache error log may have more information.
failed!
Best wishes
Partial solved with #favoretti 's advice:
#apt-get install libapache2-mod-passenger
#/etc/init.d/apache2 reload
Reloading web server config: apache2.
Means the errors are gone
I arrived due to googling "Invalid command 'RailsBaseURI'. There wasn't an answer for me here, but I later realized that this error was being caused by passenger not being enabled.
Assuming you have already installed it, you can enable passenger with sudo a2enmod passenger.
You should check passenger configure.
1.whether link passenger.conf and passenger.load in /etc/apache2/mods-enabled
/etc/apache2/mods-enabled# ls passenger.*
passenger.conf
passenger.load
2.check your configure files: passenger.conf/passenger.load
passenger.conf:
<IfModule mod_passenger.c>
PassengerRoot /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14
PassengerDefaultRuby /home/hao/.rvm/wrappers/ruby-1.9.3-p448#rails4.0/ruby
</IfModule>
passenger.load:
LoadModule passenger_module /home/hao/.rvm/gems/ruby-1.9.3-p448#rails4.0/gems/passenger-4.0.14/buildout/apache2/mod_passenger.so
3.whether passenger is runnig, according to official doc
Restart your web server and run:
passenger-memory-stats

Resources