I am tried to enter that in the SSH window, but ti says it isn’t available. Can I get help how to pull up that information?
Exactly what did you enter, and exactly what was the error message?
/etc/apache2/sites-available/wordpress-le-ssl.conf
is – or should be – a text file, not a command. So you can run a command like “cat /etc/apache2/sites-available/wordpress-le-ssl.conf
” to display it.
Here is what I entered:
doug@wordpress-nextstudy-vm:~/certbot/certbot/certbot$ /etc/apache2/sites-available/wordpress-le-ssl.conf?
-bash: /etc/apache2/sites-available/wordpress-le-ssl.conf?: No such file or directory
doug@wordpress-nextstudy-vm:~/certbot/certbot/certbot$ cd
doug@wordpress-nextstudy-vm:~ /etc/apache2/sites-available/wordpress-le-ssl.conf?
-bash: /etc/apache2/sites-available/wordpress-le-ssl.conf?: No such file or directory
doug@wordpress-nextstudy-vm:~
doug@wordpress-nextstudy-vm:~ cat/etc/apache2/sites-available/wordpress-le-ssl.conf -bash: cat/etc/apache2/sites-available/wordpress-le-ssl.conf: No such file or directory doug@wordpress-nextstudy-vm:~
There needs to be a space after "cat
".
doug@wordpress-nextstudy-vm:~$ cat /etc/apache2/sites-available/wordpress-le-ssl.conf
<VirtualHost *:443>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName www.nextstudy.org
ServerAlias nextstudy.org
Redirect / https://nextstudy.org/
Options FollowSymLinks
AllowOverride None
<Directory /var/www/html/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory “/usr/lib/cgi-bin”>
AllowOverride None
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
ErrorLog ${APACHE_LOG_DIR}/error.log
Possible values include: debug, info, notice, warn, error, crit,
alert, emerg.
LogLevel warn
CustomLog ${APACHE_LOG_DIR}/access.log combined
Include /etc/letsencrypt/options-ssl-apache.conf
SSLCertificateFile /etc/letsencrypt/live/nextstudy.org-0001/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/nextstudy.org-0001/privkey.pem
You are wonderful. How do I get rid of the redirect?
You can use a text editor to modify this file. The one that’s most often recommended to novices is nano
because it’s fairly self-documenting.
Do I simply remove everything after the word redirect?
You could comment out the line by adding a #
character at the beginning, so that you preserve the information about what used to be there but prevent it from having an effect on your configuration.
What file or file name should I open with nano?
Thanks. I looked in varied of files, but only found code in Apache2.conf, but no redirect command.
Any other file name you would suggest I look in? Below is what file types I tried.
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/conf-enabled
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/apache2.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/sites-enabled.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/conf-enabled.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/mods-enabled.conf
doug@wordpress-nextstudy-vm:~ nano /etc/apache2/apache2.conf
I think I found the right file - /etc/apache2/sites-available/wordpress-le-ssl.conf
When I put “#” in front of the redirect and tried to save it said permission denied, but I have the highest level of ownership. Any idea why?
Try putting sudo
in front of the command.
Here is the error message I am getting. Any idea why or anything else to try? I have “owner” roles
Below is the error message I am getting.
[ Error writing /etc/apache2/sites-available/wordpress-le-ssl.conf: Permission denied ]
^G Get Help ^O WriteOut ^R Read File ^Y Prev Page ^K Cut Text ^C Cur Pos
But are you running the text editor as root?
With e.g. “sudo nano
” or by using “sudoedit
”?
Thank you it worked! Do I need to reset or restart the server for it take effect? I am still getting the same error message of too many redirects.
Try sudo service apache2 reload
to get your Apache server to pick up the new configuration.
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.