VectorLinux
September 30, 2014, 02:13:24 am *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: [solved] lighttpd  (Read 3521 times)
MarkGrieveson
Vectorian
****
Posts: 531


« on: September 23, 2012, 02:55:48 pm »

I installed lighttpd but I can't seem to start it.  I've checked /var/www/htdocs-lighttpd, where I put both a test index.html and then a test index.php file, but it just shows the files, rather than projecting the webpage.  Is there a command to start the server?  I've also tried connecting to the localhost:80, but it tells me that "Firefox can't establish a connection to the server at localhost."  
« Last Edit: September 24, 2012, 07:53:04 am by MarkGrieveson » Logged

I am using VL7.0 standard with XFCE
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #1 on: September 23, 2012, 03:51:53 pm »

Tried to start it, but got the following feedback:

Code:
root:# /etc/rc.d/rc.lighttpd start
Starting lighttpd: /usr/sbin/lighttpd
2012-09-23 20:10:39: (server.c.782) can't find username lighttpd

So, I'm not sure what to do now.  Suggestions?
Logged

I am using VL7.0 standard with XFCE
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #2 on: September 23, 2012, 04:16:54 pm »

Okay, I think I got it started, anyway (which I suppose is something).

Code:
root:# /etc/rc.d/rc.lighttpd start
Starting lighttpd: /usr/sbin/lighttpd
Already running!

To address the issue I raised in post #2, I commented out the the user and group designation of "lighttpd".  So, it did start, but it gave me a 403 error, saying that I was forbidden to view it.  Here are the changes I made to /etc/lighttpd/lighttpd.conf (basically I just commented out the server.username and server.groupname):

Code:
## change uid to <uid> (default: don't care)
#change by Mark
#server.username            = "lighttpd"


## change uid to <uid> (default: don't care)
#20120923 change by Mark:
#server.groupname           = "lighttpd"

So, that's not going to work.  Any idea how I can properly add the user and group "lighttpd"?  Any idea why the installation of lighttpd didn't already do this if it's a requirement of running the program?
Logged

I am using VL7.0 standard with XFCE
hata_ph
Packager
Vectorian
****
Posts: 3257


-- Just being myself --


« Reply #3 on: September 23, 2012, 04:24:14 pm »

show us your /etc/passwd and /etc/group

EDIT:

Run below command as root to manually add lighttpd user

Quote
groupadd -g 208 lighttpd
useradd -u 208 -g lighttpd -d /var/www lighttpd
« Last Edit: September 23, 2012, 04:36:29 pm by hata_ph » Logged
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #4 on: September 23, 2012, 04:45:53 pm »

Thanks hata_ph, that's great.  I changed the conf file back to how it had been previously, and it started without complaint this time.  So, progress.  However, I still get a 403 error.  There must be permission issues with the root directory, that being with /var/www/htdocs-lighttpd.  Should I "chmod 0755" this directory and those that lead to it (and its contents)?

PS, here is my /etc/group and /etc/passwd, as requested:

Code:
root:x:0:root
bin:x:1:root,bin
daemon:x:2:root,bin,daemon
sys:x:3:root,bin,adm
adm:x:4:root,adm,daemon
tty:x:5:
disk:x:6:root,adm,mark
lp:x:7:lp,mark
mem:x:8:
kmem:x:9:
wheel:x:10:root
floppy:x:11:mark
mail:x:12:mail
news:x:13:news
uucp:x:14:uucp
man:x:15:
dialout:x:16:uucp,mark
audio:x:17:mark
video:x:18:mark
cdrom:x:19:mark
games:x:20:mark
slocate:x:21:mark
utmp:x:22:
smmsp:x:25:smmsp
tape:x:26:
mysql:x:27:
rpc:x:32:
sshd:x:33:sshd
gdm:x:42:
shadow:x:43:
ftp:x:50:
oprofile:x:51:
apache:x:80:
messagebus:x:81:
haldaemon:x:82:
plugdev:x:83:mark
power:x:84:mark
netdev:x:86:mark
pop:x:90:pop
scanner:x:93:mark
nobody:x:98:nobody
nogroup:x:99:
users:x:100:mark
console:x:101:
lock:x:120:
burning:x:121:
mark:x:1000:
avahi:x:214:
lighttpd:x:208:

Code:

  GNU nano 2.3.0                    File: /etc/passwd                                               

root:x:0:0::/root:/bin/bash
bin:x:1:1:bin:/bin:/bin/false
daemon:x:2:2:daemon:/sbin:/bin/false
adm:x:3:4:adm:/var/log:/bin/false
lp:x:4:7:lp:/var/spool/lpd:/bin/false
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/:/bin/false
news:x:9:13:news:/usr/lib/news:/bin/false
uucp:x:10:14:uucp:/var/spool/uucppublic:/bin/false
operator:x:11:0:operator:/root:/bin/bash
games:x:12:100:games:/usr/games:/bin/false
ftp:x:14:50::/home/ftp:/bin/false
smmsp:x:25:25:smmsp:/var/spool/clientmqueue:/bin/false
mysql:x:27:27:MySQL:/var/lib/mysql:/bin/false
rpc:x:32:32:RPC portmap user:/:/bin/false
sshd:x:33:33:sshd:/:/bin/false
gdm:x:42:42:GDM:/var/lib/gdm:/bin/false
oprofile:x:51:51:oprofile:/:/bin/false
apache:x:80:80:User for Apache:/srv/httpd:/bin/false
messagebus:x:81:81:User for D-BUS:/var/run/dbus:/bin/false
haldaemon:x:82:82:User for HAL:/var/run/hald:/bin/false
pop:x:90:90:POP:/:/bin/false
nobody:x:99:99:nobody:/:/bin/false
mark:x:1000:1000:Mark Grieveson:/home/mark:/bin/bash
avahi:x:214:214:Avahi User:/dev/null:/bin/false
lighttpd:x:208:208::/var/www:
« Last Edit: September 23, 2012, 04:52:01 pm by MarkGrieveson » Logged

I am using VL7.0 standard with XFCE
hata_ph
Packager
Vectorian
****
Posts: 3257


-- Just being myself --


« Reply #5 on: September 23, 2012, 08:55:00 pm »

show us the permission of /var/www
Logged
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #6 on: September 23, 2012, 10:11:38 pm »

I put the contents of the unpacked friendica source within it, since I was interested in trying to get that working.  Anyway, here's the permissions:

Code:
drwxr-xr-x 15 root root 4096 Sep 23 21:17 www/

And here's the contents permissions:

Code:
vector://var
mark:$ ls -l www
total 244
-rwxr-xr-x  1 root root 12000 Sep 23 18:05 INSTALL.txt*
-rwxr-xr-x  1 root root  1091 Sep 23 18:05 LICENSE*
-rwxr-xr-x  1 root root   582 Sep 23 18:05 README*
-rwxr-xr-x  1 root root 50052 Sep 23 18:05 boot.php*
-rwxr-xr-x  1 root root  2519 Sep 23 18:05 build.xml*
-rwxr-xr-x  1 root root   571 Sep 23 18:05 convert_innodb.sql*
-rwxr-xr-x  1 root root 32249 Sep 23 18:05 database.sql*
drwxr-xr-x  2 root root  4096 Sep 23 18:05 doc/
-rwxr-xr-x  1 root root   234 Sep 23 18:05 docblox.dist.xml*
-rwxr-xr-x  1 root root  3202 Sep 23 18:05 htconfig.php*
drwxr-xr-x  2 root root  4096 Sep 23 21:17 htdocs-lighttpd/
drwxr-xr-x  3 root root  4096 Sep 23 18:05 images/
drwxr-xr-x  3 root root  4096 Sep 23 18:05 include/
-rwxr-xr-x  1 mark mark   713 Sep 23 19:07 index.html*
-rwxr-xr-x  1 root root 10260 Sep 23 18:06 index.php*
drwxr-xr-x  2 root root  4096 Sep 23 18:05 js/
drwxr-xr-x 19 root root  4096 Sep 23 18:05 library/
drwxr-xr-x  2 root root  4096 Sep 23 18:05 mod/
drwxr-xr-x  2 root root  4096 Sep 23 18:05 mods/
drwxr-xr-x  2 root root  4096 Sep 23 18:05 object/
drwxr-xr-x  2 root root  4096 Sep 23 18:05 spec/
-rwxr-xr-x  1 root root   516 Sep 23 18:05 testargs.php*
drwxr-xr-x  2 root root  4096 Sep 23 18:05 tests/
-rwxr-xr-x  1 root root 40899 Sep 23 18:05 update.php*
drwxr-xr-x  3 root root  4096 Sep 23 18:05 util/
drwxr-xr-x 14 root root 12288 Sep 23 18:05 view/
vector://var
mark:$
Logged

I am using VL7.0 standard with XFCE
MarkGrieveson
Vectorian
****
Posts: 531


« Reply #7 on: September 24, 2012, 07:47:40 am »

Okay, I did get it working.  Turns out that I had an "index.php" file there, and currently on my system lighttpd is not set to use php.  So, I removed this file, and created simply an "index.html" file, and this worked.  It was not forbidden.  

Now the trick will be getting cgi and php working.  I had another thread on that a while ago, so I'll mark this as solved, since lighttpd is now working, and go to the other thread to work on enhancements to the webserver.  Thanks again for your help, hata_ph.
« Last Edit: September 24, 2012, 07:54:10 am by MarkGrieveson » Logged

I am using VL7.0 standard with XFCE
hata_ph
Packager
Vectorian
****
Posts: 3257


-- Just being myself --


« Reply #8 on: September 24, 2012, 06:16:43 pm »

glad to help
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!