Howto install a webserver, php and mysql

Please put your howto's and guides here

Postby Bryan » 20 Apr 2007 23:33

Yes it should. It works for me that way. Consult the lighttpd manual else.

Tips for others, if you do not frequently use php, consider installing it as a cgi instead of fcgi.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby Hans » 30 May 2007 20:04

I want to run Python on the MSS. Possible?
Hans
Member
 
Posts: 22
Joined: 22 Nov 2005 08:58

Re: Howto install a webserver, php and mysql

Postby Bartek » 25 Jul 2007 00:23

Hello,

I was able to install lighttpd and libxml2 but everytime I try to install php5 Maxtor hangs.
Only thing I can do is to ping the box and hard reset (unplug the power).
I have atm web server running.

EDIT:

I was able to install php. I'm lame when it comes to linux and I got problem with running php:

Code: Select all
# /opt/bin/lighttpd/bin/lighttpd
# /opt/lib/php5/bin/php5: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
2007-07-25 12:27:22: (mod_fastcgi.c.1048) the fastcgi-backend /opt/bin/php failed to start:
2007-07-25 12:27:22: (mod_fastcgi.c.1052) child exited with status 127 /opt/bin/php
2007-07-25 12:27:22: (mod_fastcgi.c.1055) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' in the output, NOT (cgi) NOR (cli)
For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program
2007-07-25 12:27:22: (mod_fastcgi.c.1060) If this is PHP on Gentoo add fastcgi to the USE flags
2007-07-25 12:27:22: (mod_fastcgi.c.1356) [ERROR]: spawning fcgi failed.
2007-07-25 12:27:22: (server.c.834) Configuration of plugins failed. Going down.


Sometime it's starts:
html pages are working, php not.

This is my config, is it right?:
Code: Select all
# cat /opt/bin/lighttpd/lighttpd.conf
server.document-root = "/opt/bin/lighttpd/var/wwwroot"
server.port = 8080
server.pid-file = "/opt/bin/lighttpd/.pid"

mimetype.assign = (
    ".html" => "text/html",
    ".txt"  => "text/plain",
    ".jpg"  => "image/jpeg",
    ".png"  => "image/png"
)

dir-listing.activate = "enable"
static-file.exclude-extensions = ( ".php" )
index-file.names = ( "index.html", "index.php" )

server.modules = ("mod_fastcgi", )

fastcgi.server = (
    ".php" => ((
    "bin-path" => "/opt/bin/php",
    "socket" => "/opt/bin/lighttpd/php.socket",
    "max-procs" => 2,
    "bin-environment" => (
         "PHP_FCGI_CHILDREN" => "4",
         "PHP_FCGI_MAX_REQUESTS" => "32"
    ),
    "bin-copy-environment" => ( "PATH", "SHELL", "USER"),
    "broken-scriptfilename" => "enable"
    ))
)


Any1 could please help me, I need php badly.
Bartek
Junior Member
 
Posts: 9
Joined: 20 Mar 2007 01:28
Location: Poland

Re: Howto install a webserver, php and mysql

Postby Bryan » 10 Nov 2007 21:36

Hans wrote:I want to run Python on the MSS. Possible?

You will need Python from http://defenne.xs4all.nl/ipk/. You can then run Python as CGI.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby Bryan » 10 Nov 2007 21:37

Bartek wrote:Hello,

I was able to install lighttpd and libxml2 but everytime I try to install php5 Maxtor hangs.
Only thing I can do is to ping the box and hard reset (unplug the power).
I have atm web server running.

EDIT:

I was able to install php. I'm lame when it comes to linux and I got problem with running php:

Code: Select all
# /opt/bin/lighttpd/bin/lighttpd
# /opt/lib/php5/bin/php5: error while loading shared libraries: libmysqlclient.so.15: cannot open shared object file: No such file or directory
2007-07-25 12:27:22: (mod_fastcgi.c.1048) the fastcgi-backend /opt/bin/php failed to start:
2007-07-25 12:27:22: (mod_fastcgi.c.1052) child exited with status 127 /opt/bin/php
2007-07-25 12:27:22: (mod_fastcgi.c.1055) if you try do run PHP as FastCGI backend make sure you use the FastCGI enabled version.
You can find out if it is the right one by executing 'php -v' and it should display '(cgi-fcgi)' in the output, NOT (cgi) NOR (cli)
For more information check http://www.lighttpd.net/documentation/fastcgi.html#preparing-php-as-a-fastcgi-program
2007-07-25 12:27:22: (mod_fastcgi.c.1060) If this is PHP on Gentoo add fastcgi to the USE flags
2007-07-25 12:27:22: (mod_fastcgi.c.1356) [ERROR]: spawning fcgi failed.
2007-07-25 12:27:22: (server.c.834) Configuration of plugins failed. Going down.


Sometime it's starts:
html pages are working, php not.

This is my config, is it right?:
Code: Select all
# cat /opt/bin/lighttpd/lighttpd.conf
server.document-root = "/opt/bin/lighttpd/var/wwwroot"
server.port = 8080
server.pid-file = "/opt/bin/lighttpd/.pid"

mimetype.assign = (
    ".html" => "text/html",
    ".txt"  => "text/plain",
    ".jpg"  => "image/jpeg",
    ".png"  => "image/png"
)

dir-listing.activate = "enable"
static-file.exclude-extensions = ( ".php" )
index-file.names = ( "index.html", "index.php" )

server.modules = ("mod_fastcgi", )

fastcgi.server = (
    ".php" => ((
    "bin-path" => "/opt/bin/php",
    "socket" => "/opt/bin/lighttpd/php.socket",
    "max-procs" => 2,
    "bin-environment" => (
         "PHP_FCGI_CHILDREN" => "4",
         "PHP_FCGI_MAX_REQUESTS" => "32"
    ),
    "bin-copy-environment" => ( "PATH", "SHELL", "USER"),
    "broken-scriptfilename" => "enable"
    ))
)


Any1 could please help me, I need php badly.

You will need to install MySQL from http://defenne.xs4all.nl/ipk/, even though you don't need to run it. It is possible to compile PHP as static binary to overcome such problems, but I currently don't have time for it.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby Iris » 05 Dec 2007 06:40

I've been trying to get lighttpd working to no avail. Following this tutorial the packages appeared to install okay. I did execute the following to see if lighttpd would simply run before doing any configuring:

# /opt/etc/init.d/S80lighttpd start
Starting web server: lighttpd
/opt/sbin/lighttpd: error while loading shared libraries: cannot open shared object file: cannot load shared object file: No such file or directory
#

I did have to download some add'l libs as pointed out like libpthread but I still get the above error. As far as I can tell I have the libs etc mentioned but my diagnostics capabilities with linux are weak as I'm not as familiar with it as I'd like to be. I have installed other packages like mt-daapd, etc. so I'm not totally inept :shock:

Anyways. if someone could help me diagnose my problem and get me up and running I'd be forever in their debt.

Thanls
Iris
Junior Member
 
Posts: 8
Joined: 22 Aug 2007 23:58

Re: Howto install a webserver, php and mysql

Postby Bryan » 07 Dec 2007 11:35

Did you also install libc6 that I mentioned? And if you start /opt/bin/lighttpd/bin/lighttpd maunally? Does that work?
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby Iris » 07 Dec 2007 16:53

Bryan wrote:Did you also install libc6 that I mentioned? And if you start /opt/bin/lighttpd/bin/lighttpd maunally? Does that work?


Yes - libc6 is installed.

My installation created the executable so to speak in /opt/sbin/lighttpd and I get the same error as posted. The path you posted lighttpd doesn't exist.

That's what I'm thinking is that perhaps when I installed "ipkg install lighttpd" it placed some files in different directories but the configuration is looking elsewhere like the path you posted. And, as I do not know where the files should be if someone could walk me through checking that part first perhaps that will be the cause of it not running?

Thanks for your reply Bryan.
Iris
Junior Member
 
Posts: 8
Joined: 22 Aug 2007 23:58

Re: Howto install a webserver, php and mysql

Postby Iris » 08 Dec 2007 17:23

Bryan, I got it working.

The installation of lighttpd was being done from a different package then the one hosted by you. So I just cleared out the the other two respositories that I had in ipkg.conf - forcing yours to install. The PHP info displayed so I guess I'm up and running. Now to learn all about lighttpd.

Iris
Iris
Junior Member
 
Posts: 8
Joined: 22 Aug 2007 23:58

php.ini settings [Bryan]

Postby Iris » 22 Dec 2007 08:04

Hi Bryan,

The phpinfo file I created reports my timezone as UTC. I created and edited a php.ini file to reflect my correct timezone but it isn't recognized. Is a reference to where the php.ini is located required or something? I created it in /opt/etc/ - that's the location reported here and by my phpinfo. Could you help?

Iris
Iris
Junior Member
 
Posts: 8
Joined: 22 Aug 2007 23:58

Re: Howto install a webserver, php and mysql

Postby seanlv » 07 Mar 2008 08:34

Iris wrote:Hi Bryan,

The phpinfo file I created reports my timezone as UTC. I created and edited a php.ini file to reflect my correct timezone but it isn't recognized. Is a reference to where the php.ini is located required or something? I created it in /opt/etc/ - that's the location reported here and by my phpinfo. Could you help?

Iris



I meet same problem, PHP.INI does not work ~ Any Idea?
seanlv
Junior Member
 
Posts: 7
Joined: 25 Feb 2007 18:43
Location: BJ

Re: Howto install a webserver, php and mysql

Postby Bryan » 17 Mar 2008 22:29

No idea, I don't use PHP anymore.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby ZEUS_1 » 23 Sep 2008 08:16

Hello all together,

I just installed webserver, php and mysql.
Here is my workaround. Maybe this helps someone.

1. Firmware upgrade to openmss 2.6.2 rc2
2. telnet to mss / or ssh (dropbear & busybox allready installed)
3.
Code: Select all
cat >> /opt/etc/ipkg.conf
src bryan http://ipkg.openmss.org/bryan
{Press: ctrl+d}

4.
Code: Select all
ipkg update

5.
Code: Select all
ipkg install libc6

6.
Code: Select all
ipkg install lighttpd

Configure /opt/bin/lighttpd/lighttpd.conf (this file includes php.ini, auth, access_log
Code: Select all
server.document-root = "/shares/mss-hdd/www"
server.port = 8080
server.pid-file = "/opt/bin/lighttpd/.pid"

mimetype.assign = (
".html" => "text/html",
".txt" => "text/plain",
".jpg" => "image/jpeg",
".png" => "image/png"
)

index-file.names = ( "index.html" ,"index.php" )

dir-listing.activate = "enable"

static-file.exclude-extensions = ( ".php" )
server.modules = (
      "mod_fastcgi",
      "mod_auth",
      "mod_accesslog" )

fastcgi.server = (
           ".php" => ((
      "bin-path" => "/opt/bin/php -c /opt/etc/php.ini",
      "socket" => "/opt/bin/lighttpd/php.socket",
      "max-procs" => 2,
      "bin-environment" => (
      "PHP_FCGI_CHILDREN" => "4",
      "PHP_FCGI_MAX_REQUESTS" => "32"
      ),
      "bin-copy-environment" => ( "PATH", "SHELL", "USER"),
      "broken-scriptfilename" => "enable"
      ))
)

#### accesslog module
accesslog.filename          = "/shares/mss-hdd/__opt/var/log/access.log"

## debugging
# 0 for off, 1 for 'auth-ok' messages, 2 for verbose debugging
auth.debug                 = 0

## type of backend
# plain, htpasswd, ldap or htdigest
auth.backend               = "htpasswd"

## for htpasswd - user-file (user_name:hash - created by htpasswd)
auth.backend.htpasswd.userfile = "/opt/bin/lighttpd/lighttpd-htpasswd.user"

auth.require = ( "/" =>
               (
               # method must be either basic or digest
               "method"  => "basic",
               "realm"   => "what ever you want",
               "require" => "user=xxx|user=yyy|user=yyy"
               )
               )

7. Configure /opt/etc/php.ini
Code: Select all
register_globals=on

8.
Code: Select all
ipkg install libxml2
ipkg install php5
ipkg install mysql

9 create phpinfo.php and test it
Code: Select all
cat > /opt/bin/lighttpd/var/wwwroot/phpinfo.php
<?php phpinfo(); ?>
{Press: ctrl+d}
ZEUS_1
Newbie
 
Posts: 2
Joined: 23 Sep 2008 07:41

Re: Howto install a webserver, php and mysql

Postby Bryan » 25 Sep 2008 18:16

ZEUS_1 wrote:7. Configure /opt/etc/php.ini
Code: Select all
register_globals=on



register_globals is the root of all evil. Please don't use it if you don't need it.
Python 2.5, CTorrent dnh3.2, Busybox 1.2.0
Bryan
Senior Member
 
Posts: 125
Joined: 16 Jun 2006 16:50

Re: Howto install a webserver, php and mysql

Postby eilz » 31 Oct 2008 01:44

tHANKS TO EVERYONE FOR ALL THERE FEEDBACK I FINALLY GOT BOTH PHP AND SQL WORKING

I have installed the web lighttpd but trying to edit the conf file, but when I type vi it is not found, what else can I use to edit these files.

sorry, my unix is real bad.
eilz
Junior Member
 
Posts: 7
Joined: 09 Nov 2006 16:16

PreviousNext

Return to Guides

Who is online

Users browsing this forum: No registered users and 2 guests