Welcome! Log In Create A New Profile

Advanced

Basic website configuration

Posted by xtjoliverx 
Basic website configuration
October 04, 2014 02:53PM
Hello, I am new to the forum, and to linux for that matter. I have Ubuntu 14.04 LTS installed on a Dell PowerEdge server that I got for almost nothing. I purchased a domain idi-welding.com and have been messing with nginx for about a month now. I have tried every tutorial I could find, and cannot get any of them to work. I was wondering if anyone could point me to a write up explaining how to set up a single website using nginx. If someone could explain to me how to copy and paste my conf/sites-available/sites-enabled files I will post them, maybe one of the users on this forum could spot what I am doing wrong. It seems like nginx isnt using my website directory. But, when I type in the following command:

cat /etc/nginx/sites-available/* | grep root | sed 's/^[ /t ]*//' | sed '/^\#d'

it says that it is using my home/tj/html directory. The same goes for sites-enabled. But, it is still displaying the welcome to nginx page when I type in my local IP address into the servers browser. I can view that page by typing the servers local IP from any computer on my network. But, when I type in idi-welding.com nothing is displayed. If someone can explain how to copy and paste I can post the contents of the config files, but I can figure out how to copy and paste in the terminal. Any help is greatly appreciated.
Re: Basic website configuration
October 04, 2014 09:45PM
OK, so I figured out how to copy and paste. I will post my /etc/nginx/nginx.conf file then sites-available and finally sites-enabled hopefully someone can see what I am doing wrong. But, before I do just want to mention my server is on a LAN behind a router if that matters. I also have port 8080 on my router forwarded to my server.


user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
worker_connections 768;
# multi_accept on;
}

http {

##
# Basic Settings
##

sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
# server_tokens off;

# server_names_hash_bucket_size 64;
# server_name_in_redirect off;

include /etc/nginx/mime.types;
default_type application/octet-stream;

##
# Logging Settings
##

access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;

##
# Gzip Settings
##

gzip on;
gzip_disable "msie6";

# gzip_vary on;
# gzip_proxied any;
# gzip_comp_level 6;
# gzip_buffers 16 8k;
# gzip_http_version 1.1;
# gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+$

##
# nginx-naxsi config
##
# Uncomment it if you installed nginx-naxsi
##

#include /etc/nginx/naxsi_core.rules;

##
# nginx-passenger config
##
# Uncomment it if you installed nginx-passenger
##

#passenger_root /usr;
#passenger_ruby /usr/bin/ruby;

##
# Virtual Host Configs
##

include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/www;

}


#mail {
# # See sample authentication script at:
# # http://wiki.nginx.org/ImapAuthenticateWithApachePhpScript
#
# # auth_http localhost/auth.php;
# # pop3_capabilities "TOP" "USER";
# # imap_capabilities "IMAP4rev1" "UIDPLUS";
#
# server {
# listen localhost:110;
# protocol pop3;
# proxy on;
# }



Edited 2 time(s). Last edit at 10/04/2014 09:50PM by xtjoliverx.
Re: Basic website configuration
October 04, 2014 09:46PM
Here is my sites-available file:

server{
listen 127.0.0.1:8080;
server_name www.idi-welding.com *.idi-welding.com;
rewrite ^/(.*) http://idi-welding.com/$1 permanent;
}

server {

listen 8080;
server_name idi-welding.com;

location / {
try_files $uri $uri/ /index.html;
root /home/tj/html/;
index index.html;
}

## location /html/ {
## alias /home/tj/html/;
## autoindex on;
## }
}
Re: Basic website configuration
October 04, 2014 09:48PM
Here is my sites-enabled file:

server{
listen 127.0.0.1:8080;
server_name www.idi-welding.com *.idi-welding.com;
rewrite ^/(.*) http://idi-welding.com/$1 permanent;
}

server {

listen 8080;
server_name idi-welding.com;

location / {
try_files $uri $uri/ /index.html;
root /home/tj/html/;
index index.html;
}

## location /html/ {
## alias /home/tj/html/;
## autoindex on;
## }
}
Re: Basic website configuration
October 07, 2014 07:50PM
Wow, 104 views and not one of them could tell me how to do a basic task?
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 230
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready