Digital Ocean HTML Files Uploaded Not Working - html

I have uploaded some html files to my Digital Ocean droplet, on directory /var/www/html, but apparently I still can't connect to http://vps-ip-address, how can I make those files work on default http port when simply typing http://vps-ip-address? I know I'm missing something out and it's probably a newbie mistake, so if someone could explain to me how it can be done, I would be grateful.

By default on Ubuntu, the document root for Nginx is located at /usr/share/nginx/html In order to serve content from /var/www/html you will need to edit your Nginx configuration. The default configuration file is /etc/nginx/sites-enabled/default
Find the line:
root /usr/share/nginx/html;
and change it to:
root /var/www/html;
Then restart Nginx with sudo service nginx restart

Related

how to setup phpmyadmin on nginx with laraval?

does anybody know how to setup phpmyadmin on nginx server (ubuntu) with laravel?..
my site is built with laravel and hosted on /var/www/mysite/
the default nginx-config is disabled...site is not hosted under the default html directory, but on the /var/www/mysite directory...(because i plan to host one more site on the same server in future)
Laraval installation works, but i am unable to access phpmyadmin..
i have already tried the ln -s /usr/share/phpmyadmin /var/www/mysite/ approach but laravel gives a 404 error
the guides found on the internet do not specify how to install phpmyadmin onto a nginx-laravel combo.. the settings are different than a normal nginx only installation..
does anybody know the correct steps to make it working?
Your question is not about use specifically phpmyadmin, but how to use more than one site under the same host with nginx, it doesn't matter if it is phpmyadmin. If you already have your website at /var/www/mysite you cannot map the phpmyadmin to the same path (symlink), you have to map it to another folder, like this:
ln -s /usr/share/phpmyadmin /var/www/phpmyadmin/
Make sure that your .conf files at nginx are right, post them here.
Remember to reload the server and it could be the case to map the public phpmyadmin folder (that contains index file) if it exists.
Check it out: https://fedingo.com/how-to-host-multiple-domains-on-one-server-in-nginx/
English isn't my first language, ask me again if you didn't understand something.

Flask and Nginx: css not recognized

I am trying to deploy my website using Flask. Everything is working perfectly locally (localhost:5000), but when I deploy it on my distant linux ubuntu server (www.linode.com) I encouter a problem. I have installed gunicorn and nginx, but my CSS files are not taken into account, thus, my webpage just appears as an HTML content alone, without shape/colors and so on.
I am very new at web development, and I don't understand why it works perfectly locally and not anymore (not totally) on the linux server. Is the problem related to the nginx that can't manage to do the link between HTML and CSS? Because locally I don't need to use nginx, and everything works.
Here is my nginx config file for when I type sudo nano /etc/nginx/sites-enabled/assets:
server {
listen 80;
server_name 45.79.250.111;
include /etc/nginx/mime.types;
location /static {
alias /home/gardy/ladybird_site/assets/static;
}
location / {
proxy_pass http://localhost:8000;
include /etc/nginx/proxy_params;
proxy_redirect off;
}
}
And here is my website directory tree:
ladybird_site/
requirements.txt
run.py
assets/
__init__.py
config.py
models.py
fonts/
et-line.eot
...
fontawesome-webfont.woff2
main/
routes.py
__init__.py
templates/
index.html
layout.html
static/
css/
animate.css
bootstrap.min.css
font-awesome.min.css
style.css
bxslider/
jquery.bxslider.css
images/
bx_loader.gif
controls.png
et-line-font/
style.css
magnific-popup/
magnific-popup.css
owl-carousel/
owl.carousel.css
owl.theme.css
owl.transitions.css
images/
ldb_ico.ico
founder_pics/
custom_pics/
f1.jpg
f2.jpg
f3.jpg
ldb_imgs/
1.png
2.png
3.png
js/
bootstrap-hover-dropdown.min.js
bootstrap.min.js
...
jquery.bxslider.min.js
main.js
I am getting crazy with that stuff, trying and modifying things since two days without significant improvments, and found no answers on the internet...
Thanks a lot
Your static path looks fine. You have set your server to listen to port 80, which is the default port for HTTP, but maybe you have not opened it. The next step is for you to open it.
sudo ufw allow http/tcp
You mention that your server is still listening to port 5000. However, if you are done with testing, you can disallow this port from being used by Nginx.
sudo ufw delete allow 5000
Enable these new rules by running the command below:
sudo ufw enable
# Hit 'y' for 'yes' when prompted
Finally, you can now restart your Nginx server:
sudo systemctl status nginx.service
If you navigate to your application's IP address, and append static/css/style.css, you should be able to access your CSS file. I mean http://<your IP address>/static/css/style.css

Issues with misconfigured Apache vhosts

I have issues with setup correct vhosts in Apache.
simlink ln -s /mnt/d/localdevelopment /var/www/localdevelopment
In mysite.local.conf
DocumentRoot /var/www/localdevelopment/mysite
The issues is when I go to mysite.local I get the index of localdevelopment
If I navigate to the directory mysite is going to mysite.local/localdevelopment/mysite and is not working.
Any ideas what i am doing wrong?
It's turn out that is an Apache2 issue, is displayed only the default vhost, so i have disable the conf for localdevelopment and leave only vhost for mysite and is working.
So until i found a solution, i have to disable and enable vhost to see the proper project.

nginx does not use modified index file

I installed nginx on my raspberry pi, and configured it.
However, it does not work as what I want.
The IP of raspberry pi is 192.168.0.182, so I made index.html fil and typed in my browser. But, it show nginx's default message, not my index.html.
If I use 192.168.0.182/index.html, it shows my index.html.
What I want it not to use "/index.html" after IP address for index.html. How shoud I configure nginx?
This is my nginx configuration in /etc/nginx/site-available.
server{
listen 80;
root /home/xaliver/Web/www;
index index.html index.htm;
}
and I linked it by
sudo ln -s /etc/nginx/site-available/mysite /etc/nginx/site-enalbled/
Also, I putted index.html in /home/xaliver/Web/www/. The index.html is
"Hello World"
Please, let me know what I missed.
Thank you.

execute index.html on internet access to server

I'm running Apache on Ubuntu 14.04. I'm Port Forwarding 8080 to my server. I've edited ports.conf to Listen 8080. I have an index.html in /var/www/html. when I browse to MyURL:8080 I get An Index of / that shows html as a directory.
If I click the html directory icon, my index.html executes. I looked at /etc/apache2/sites-available/default-ssl.conf and 000-default.conf, they both show DocumentRoot /var/www/html. So does sites-enabled/000-default.conf.
Any help on what to try next to get the index.html to execute on entry to the server would be appreciated.
I'm by no means an expert on ubuntu's apache configuration, but through some quick searching I found this http://www.ajopaul.com/2010/05/01/ubuntu-apache2-change-default-documentroot-varwww/
Is it necessary to have a trailing "/" on the document root path?