By ipp1981
Good afternoon,
I do not have much knowledge of servers and I am having problems configuring my virtual host environment. In addition to setting up a lamp environment, I have created a domain and created a certificate within the droplet. But when I access my web from the ip http://134.122.75.77, it does load although it gives me an error when downloading the images. But when I try to access from the domain, I get a 404 error.
Attached virtual host configuration
sites-available/notasweb.conf
<VirtualHost *:80>
ServerName notasweb.me
ServerAlias www.notasweb.me
ServerAdmin *****@hotmail.com
DocumentRoot /var/www/notasweb/public
<Directory /var/www/notasweb/public/>
Options -Indexes +FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
<IfModule mod_dir.c>
DirectoryIndex index.php index.pl index.cgi index.html index.xhtml index.htm
</IfModule>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.notasweb.me [OR]
RewriteCond %{SERVER_NAME} =notasweb.me
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>
ServerName localhost
****
If you need more information do not hesitate to ask me. Please could you help me.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi there,
It sounds like Mod Rewrite is not enabled. You can do that with the following command:
sudo a2enmod rewrite
After that restart Apache to make sure that it loads the new module:
sudo systemctl restart apache2
Let me know how it goes. Best, Bobby
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.