davebra
New Around Here
Hi,
I have successfully installed THTTPD with PHP on my N66U with asuswrt merlin, Entware is not necessary.
Thanks to TeHashX's Cherokee and Lighttpd tutorials.
We need a usb-flash formatted EXT2 or a usb-hdd formated EXT3, may not work on FAT32 or NTFS and Optware installed (install Downloadmaster from Asus).
Login to router with putty/terminal and enter commands:
the php-thttpd package contains both the webserver and the php environment.
Install nano and change the thttpd configuration:
Change the folder
Change the port (port 80 is for asus admin panel)
my example:
Save (ctrl+o) and exit nano (ctrl+x)
Set folder permission (in my case is /mnt/media/FTP/www, change the /path/to/folder with your folder)
Create a simple index.php file inside
Write inside
Save (ctrl+o) and exit nano (ctrl+x)
Set permissions
Now we must setup the startup script. The php-thttpd package created the init script S80thttpd but the asus script app_set_enabled.sh doesn't recognize it because the package name isn't thttpd but is php-thttpd, so we must create a new init script with the package name (copy of original thttpd) and enable at startup:
- Reboot
- Open http://192.168.1.1:8001 (change 8001 with your port set in your thttpd.conf before) if you see the php info, all is right!
Now, we need to set the firewall to make it accessible via wan, we need asus merlin firmware and jffs enabled:
Add this lines (change 8001 with your port)
Save, exit nano and set permission
Go to port forwarding and redirect port 80 to 8001 (or your port):
After reboot should you have access from wan.
I have successfully installed THTTPD with PHP on my N66U with asuswrt merlin, Entware is not necessary.
Thanks to TeHashX's Cherokee and Lighttpd tutorials.
We need a usb-flash formatted EXT2 or a usb-hdd formated EXT3, may not work on FAT32 or NTFS and Optware installed (install Downloadmaster from Asus).
Login to router with putty/terminal and enter commands:
Code:
# ipkg update
# ipkg upgrade
# ipkg install php-thttpd
the php-thttpd package contains both the webserver and the php environment.
Install nano and change the thttpd configuration:
Code:
# ipkg install nano
# nano /opt/etc/thttpd.conf
Change the port (port 80 is for asus admin panel)
my example:
Save (ctrl+o) and exit nano (ctrl+x)
Set folder permission (in my case is /mnt/media/FTP/www, change the /path/to/folder with your folder)
Code:
# chmod 777 /path/to/folder
Create a simple index.php file inside
Code:
# nano /path/to/folder/index.php
Code:
<?php phpinfo(); ?>
Set permissions
Code:
# chmod 777 /path/to/folder/index.php
Now we must setup the startup script. The php-thttpd package created the init script S80thttpd but the asus script app_set_enabled.sh doesn't recognize it because the package name isn't thttpd but is php-thttpd, so we must create a new init script with the package name (copy of original thttpd) and enable at startup:
Code:
# cp /opt/etc/init.d/S80thttpd /opt/etc/init.d/S80php-thttpd
# chmod a+rx /opt/etc/init.d/S80php-thttpd
# app_set_enabled.sh php-thttpd yes
- Reboot
- Open http://192.168.1.1:8001 (change 8001 with your port set in your thttpd.conf before) if you see the php info, all is right!
Now, we need to set the firewall to make it accessible via wan, we need asus merlin firmware and jffs enabled:
Code:
# nano /jffs/scripts/firewall-start
Add this lines (change 8001 with your port)
Code:
#!/bin/sh
iptables -I INPUT -p tcp --destination-port 8001 -j ACCEPT
Save, exit nano and set permission
Code:
# chmod a+rx /jffs/scripts/firewall-start
Go to port forwarding and redirect port 80 to 8001 (or your port):
After reboot should you have access from wan.
Last edited: