6. centos networking
DESCRIPTION
CentOS NetworkingTRANSCRIPT
![Page 2: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/2.jpg)
Connecting to the Network withNetworkManager
• The NetworkManager applet icon (upper left) shows that NetworkManager is running.
• Check for NetworkManager• $ rpm -qa NetworkManager*• Install NetworkManager• # yum install NetworkManager-gnome
NetworkManager-glib• Start NetworkManager• # service NetworkManager start• # chkconfig NetworkManager on
![Page 3: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/3.jpg)
Local Area Networks
• Planning, Getting, and Setting Up LAN hardware—This entails choosing a network topology, purchasing the equipment you need, and installing it (adding cards and connecting wires or using wireless antennas).
• Configuring TCP/IP —To use most of the networking applications and tools that come with Linux, you must have TCP/IP configured. TCP/IP lets you communicate not only with computers on your LAN, but also with any computers that you can reach on your LAN, modem, or other network connection (particularly via the Internet).
![Page 4: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/4.jpg)
Is Your Ethernet Connection Up?
• Using the ifconfig command, you can determine whether your Ethernet (and other network interfaces) is up and running.
• # ifconfig• # ifconfig eth0 up• If your network interfaces are not running at all,
you can try to start them from the network initialization script.
• # /etc/init.d/network restart
![Page 5: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/5.jpg)
Watching LAN Traffic with Wireshark
• Wireshark Network Analyzer.
• # wireshark &
![Page 6: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/6.jpg)
Setting Web Server
• The Apache Web Server (httpd)
• Others web server– Lighttpd– Tclhttpd– Thttpd– XSP – can run ASP.NET– Zope
![Page 7: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/7.jpg)
Apache Server
• Make sure that Apache is installed
• $ rpm -qa | grep httpd
• A valid hostname is recommended if it is a public Apache server.
• can edit the /etc/httpd/conf/httpd.conf file and define the ServerName as your computer’s IP address.
![Page 8: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/8.jpg)
Apache Server
• To make the Web Server available to your LAN, you can use your IP address instead of www.example.com (e.g., ServerName 10.0.0.1). The :80 represents the port number (which is the default)
![Page 9: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/9.jpg)
Apache Server
• Start the httpd server. As root user, type the following:
• # service httpd start• To have httpd start every time you boot your
system, run the command as root user.• # chkconfig httpd on• To make sure that the Web Server is working,
open Firefox (or another Web browser),• http://localhost/• Check SELinux
![Page 10: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/10.jpg)
Monitoring Server Activities
• adding the following lines to the /etc/httpd/conf/httpd.conf file:<Location /server-status>SetHandler server-statusOrder deny,allowDeny from allAllow from 127.0.0.1</Location><Location /server-info>SetHandler server-infoOrder deny,allowDeny from allAllow from 127.0.0.1</Location>
![Page 11: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/11.jpg)
Analyzing Web-Server Traffic
• The webalizer package can take Apache log files and produce usage reports for your server.
• Those reports are created in HTML format so you can display the information graphically.
• # yum install webalizer• # webalizer• http://localhost/usage
![Page 12: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/12.jpg)
MySQLDatabase Server
• You need at least the mysql and mysql-server packages installed
• mysql—This software package contains a lot of MySQL client programs (in /usr/bin)
• mysql-server—This software package contains the MySQL server daemon (mysqld) and the mysqld startup script (/etc/init.d/mysqld)
• mysql-devel—This software package contains libraries and header files required for developing MySQL applications.
![Page 13: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/13.jpg)
MySQL
• If MySQL isn’t installed yet, type the following:
• # yum install mysql-server
• GUI software for connecting to a MySQL server
• # yum install mysql-administrator
• To launch the MySQL Administrator window, type mysql-administrator.
![Page 14: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/14.jpg)
Starting the MySQL Server
• To start the MySQL server immediately,
• # service mysqld start
• To set the MySQL server to start each time the computer reboots
• # chkconfig mysqld on
![Page 15: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/15.jpg)
Checking That MySQL Server Is Working
• # mysqladmin -u root -p version proc
• If the server were not running at the moment
• # service mysqld restart
![Page 16: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/16.jpg)
Working with MySQL Databases
• The mysql_install_db command starts you off with two databases: mysql and test.
• Starting the mysql Command
• $ mysql -u root -p mysql
![Page 17: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/17.jpg)
MySQL Command
• mysql> status
• To create a new database name, use the CREATE DATABASE
• mysql> CREATE DATABASE allusers;
• mysql> SHOW DATABASES;
• mysql> USE allusers;
![Page 18: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/18.jpg)
Create table
• mysql> CREATE TABLE name (• -> firstname varchar(20) not null,• -> lastname varchar(20) not null,• -> streetaddr varchar(30) not null,• -> city varchar(20) not null,• -> state varchar(20) not null,• -> zipcode varchar(10) not null• -> );
![Page 19: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/19.jpg)
Insert/View Data
• mysql> INSERT INTO name
• -> VALUES (’Jerry’,’Wingnut’,’167 E Street’,
• -> ‘Roy’,’UT’,’84103’);
• mysql> SELECT * FROM name;
![Page 20: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/20.jpg)
Displaying Selected Columns
• mysql> SELECT firstname,lastname,zipcode FROM name;
![Page 21: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/21.jpg)
Sorting Data
• mysql> SELECT * FROM name ORDER BY lastname;
![Page 22: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/22.jpg)
Updating and Deleting MySQL Records
• mysql> UPDATE name SET streetaddr="933 3rd Avenue" WHERE firstname="Chris";
• mysql> DELETE FROM name WHERE firstname="Chris";
![Page 23: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/23.jpg)
Adding Users and Granting Access
• mysql> GRANT USAGE ON *.*• -> TO yason@localhost IDENTIFIED BY
“yason123";• #mysql -u yason –p• have no privilege to work with any of the
databases• mysql> GRANT
DELETE,INSERT,SELECT,UPDATE ON allusers.*
• -> TO yason@localhost;
![Page 24: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/24.jpg)
Opening Your Firewall
• Web Server—Port 80• Mail Server—Port 25 (and possibly port 587)• FTP Server—Ports 20 and 21• DNS Server—Port 53 (if you’re supporting your
own DNS)• SSH Server—Port 22 (allows secure login
service to administer the computer remotely or remote users to add Web content or other server content to the server)
![Page 25: 6. centos networking](https://reader033.vdocuments.net/reader033/viewer/2022061103/5406e2f08d7f72b90a8b483a/html5/thumbnails/25.jpg)
Thank you
• http://www.yasin.my