execute index.html on internet access to server - html

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?

Related

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

can't access wamp projects online

A lot of similar questions to mine,, but really none addresses my issue!
I installed Wamp on a pc (win 7) connected to internet and i gave it a real IP (78.10*..) in which i can access it anywhere.
i did the following:
changes in httpd & phpmyadmin,, (deny all replaced with allow all) (server name "localhost:80" replaced with my public ip 78.10*..:80) ( denied replaced with granted) (added ::1)
changes in phpsysinfo, sqlbuddy,webgrin (requier local host removed ,, deny from all replaced with allow from all)
-put wamp online from its icon
-firewall is turned off
-full permission granted on local hard C and put on shared too
when i request 78.10*.. on another computer (not in my LAN) the wamp index previewed and i can access Tools(phpinfo, phpmyadminn) & Your Aliases(phpmyadmin, phpsysinfo, sqlbuddy, webgrin) but i can't access my project which located in the www directory
when i press on project named "m" a redirect page previewed and redirected me to page named localhost and says page not available, if i did same thing on my server the redirected page redirect me to localhost and i can access my project
any help will be appreciated
Thanks in advice
Change (wwwroot='localhost') to 78.10*.***.*** in your "Config.php" inside your Moodle folder.
To make your moodle folder your root directory, do the following:
You will have to edit two things inside of the httpd.conf file /wamp/apache2/conf/httd.conf find:
DocumentRoot "/wamp/www"
change to
DocumentRoot "your_moodle_folder"
then find:
<Directory "wamp/www">
change to
<Directory "your_moodle_folder">
Save it and restart apache.

Digital Ocean HTML Files Uploaded Not Working

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

documentroot not correct?

I cannot see an index.html in my site root. http://localhost/index.html does not work. Also 127.0.0.1/index.html and one other aa.local/index.html doesn't work either. But if I remove index.html to any of those above domains I get the Centos apache welcome screen. On the welcome page it says if it doesn't find an index in the /var/www/html directory it would show the welcome page. There is an index page in the root...that is what I am referring to above. I checked the httpd.conf file and the DocumentRoot is /var/www/html. If I put in another directory in the site root and try to load up any of the pages the page is not found. If I stop the server by saying:
sudo /usr/sbin/apachectl stop
When I reload any of the pages that didn't work it now gives an "unable to connect". The welcome page is unable to connect as well. I restart it using the above but change it to start and now I am back to where I started...index.html is not found and welcome page is back if I just do the domain root.
Any ideas?
Got it...Under System->Administration->Server settings->http I changed the Server Name to be my aa.local and then I under Virtual hosts tab and then I changed the Page Options I had it look for index.html or index.php...Then I restarted the server....I think just changing the server name should have done it

AWS page just showing Apache Start page and not html file

I'm running an apache server on an Amazon EC2 basic linux instance, and I'm trying to get it to just display a simple test html file that I created. The file is in /home/ec2-user/public_html (just for test purposes). I've changed the DocumentRoot and Directory to point to this directory, but the public dns address is still just showing the default Apache start page. What else do I need to do/change to get this to actually display online?
Edit: I've also uncommented the VirtualHost *:80 line, changed the DocumentRoot and ServerName within the VirtualHost tags.
It turns out I had forgotten to change some permissions on the test.html file itself and that was causing a holdup.
check running instance's security group HTTP rule. ADD rule if not added:
Select HTTP from the Type list, and leave the source as Anywhere (0.0.0.0/0).