Advantech AE Technical Share Document Date 2015 / 07 / 15 SR# Category FAQ SOP Related OS Debian GNU/Linux 5.0 Abstract Keyword Related Product [HOWTO] UNO-1140 - Install FTP server, LAMP, Telnet and PHPmyadmin on Linux UNO-1140, FTP server, LAMP, PHPmyadmin UNO-1140 Problem Description: [HOWTO] UNO-1140 - Install FTP server, LAMP, Telnet and PHPmyadmin on Linux Brief Solution - Step by Step: 0. INSTALL LINUX OS Environment: OS: Debian GNU/Linux 5.0 DEVICE: UNO-1140 Install with the Setup Guide. When system prompt the option of automatic install and manually, please select manually and set your own password for root. (default password: Advantech if you select automatic install ) I got some problem when I use default passwd by automatic install, so I would like to recommend you use your own password manually. When setup guide prompt PARTITION OPTION, please select Partition Automatically and also select Remove all partition and install. Notice: In this document, Blue color means execute command in terminal. Page 1
1. SETUP NETWROK # ifconfig You could find out which Ethernet interface you are using. For example: eth0. In this case. Get IP address from DHCP service # dhclient eth0 Make sure you could connect to internet. You are successful if you get response. # ping www.google.com Page 2
2. UPDATE YOUR PACKAGE SOURCE Then edit mirror reference in terminal. # nano /etc/apt/sources.list Add deb http://ftp.twaren.net/debian lenny main non-free contrib into file and Comment others. (Notice: You can put another mirrors site here as well.) For example: Save it: Save File Name: Ctrl + X Y Enter # apt-get update You might get some error in response, no worry, it s normal. Page 3
# apt-get install vsftpd Type Y and Enter You might see some Permission denied but it s ok if you get Starting FTP server: vsftpd. # useradd test # passwd test Enter your passwd for test user, we enter test for example here. # mkdir /home/test/ (if system doesn t make one) # chmod 777 /home/test Restart FTP Server # /etc/init.d/vsftpd restart Now use browser to connect server if it has been installed appropriately. Confirm with you account and password. If success. You could see the directory structure under web-site: Page 4
3. Install Telnet # apt-get install telnet Finish Page 5
4. SETUP Web Server, MySQL and PHP5 Module IMPORTANT: At first, you have to create directory man1 under each directory of /usr/share/man/ For example: /usr/share/man/it/man1 /usr/share/man/pl/man1 /usr/share/man/it.iso8859-1/man1/ /usr/share/man/fr.iso8859-1/man1/ /usr/share/man/it.utf-8/man1/ /usr/share/man/pl.iso8859-2/man1/ /usr/share/man/pl.utf-8/man1/ /usr/share/man/fr/man1/ # apt-get install apache2 php5 libapache2-mod-php5 (enter Y if any prompt show up) Then edit /var/www/test.php # nano /var/www/test.php Add one line <?php phpinfo();?> into the file, Save it: Ctrl + X Y Save File Name: Enter Then nano editor would exit automatically. Now validate if the package has been installed appropriately. Use Browser and connect to http://ip/test.php You will see the page like this: Page 6
If you could not see this, please try: # nano /etc/apache2/apache2.conf And add these content into file: AddType application/x-httpd-php.php AddType application/x-httpd-php-source.phps Save and Exit. Restart Apache2 Server # /etc/init.d/apache2 restart Now try again, it supposed to be successful. Install MySQL # apt-get install mysql-server mysql-client php5-mysql You will setup your MySQL password in the installation. Verify if you could login with user root $mysql u root -p If the error occurred, for example: MYSQL ERROR 1045 (28000): Access denied for user (using password: YES) Page 7
Solution: Stop mysql service $/etc/init.d/mysql stop login with SafeMode $mysqld_safe --user=mysql --skip-grant-tables --skip-networking & create another terminal (ex. Ctrl + F2, F3, F4 etc) $mysql -uroot mysql the mysql user table might not exist mysql> select * from user; mysql> INSERT INTO user(host, user, password, select_priv, insert_priv, update_priv) VALUES ('localhost', 'username', PASSWORD( yourpassword ), 'Y', 'Y','Y'); restart MySQL service $/etc/init.d/mysql restart Try to login again $mysql u root p (New Password): **** mysql> (success!) 5. SETUP phpmyadmin # apt-get install phpmyadmin Check http://ip/phpmyadmin on browser. You will see the admin interface if successful: Page 8
Reference: N/A Page 9