forked from ReliefLabs/EasyTomato
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME_REMOTE_WWW
56 lines (51 loc) · 2.22 KB
/
README_REMOTE_WWW
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
How to install Samba and set up the router to fetch web content remotely:
Install & Setup Samba (run all these steps on the linux host):
1) Install Samba
sudo apt-get install samba
2) Create a samba user (this is seperate from linux username/password)
sudo smbpasswd -a $USER
3) Create a folder that will hold the webpages in your user directory and make it writable by all
mkdir /home/$USER/remote_www
chmod a+w /home/$USER/remote_www
4) Make a backup of the default Samba configuration file
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.default
5) Append to the Samba config file to add the directory to share (this is all a single command):
cat << EOF | sudo tee -a /etc/samba/smb.conf
[remote_www]
path = /home/$USER/remote_www
available = yes
read only = no
browsable = yes
public = yes
writable = yes
follow symlinks = yes
wide links = yes
EOF
6) Restart Samba Server
sudo restart smbd
Connect to share from the router:
7) Under Administration | CIFS Client, set the following settings:
Enable: <check>
UNC: \\192.168.1.2\remote_www (or whatever the IP of the linux machine is)
Username: easydev (whatever your linux username is)
Password: easydev (whatever the samba password you made is)
Security: None
8) Save the settings
Log in to the router and change httpd to fetch files from share:
9) Log in to the router using SSH (this may have to be enabled through the GUI, I would also suggest adding your an ssh key for passwordless login)
ssh [email protected] (or whatever your router's ip address is)
(password is your router's admin password)
10) Copy all the existing files to the share
cp -r /www/* /cifs1/.
11) Kill the existing webserver
killall httpd
12) Restart the webserver from the cifs1 directory
cd /cifs1
httpd
13) Exit the router using the exit command
exit
14) Change the permissions on the newly copied files so you can edit them
cd /home/$USER/remote_www
sudo chown -R $USER *
Everything should now be served up from your linux machine and you are free to edit things!
Warning! Saving some pages in tomato (or calles from EasyTomato to do this) will restart servies requiring you to do steps 9, 11-13 again.