Tự xây dưng web server

42 1.3K 9
Tự xây dưng web server

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Tự xây dựng web server

Author: Hieupc http://thegioiebook.com Tự xây dựng Web Server Hiện nay, Internet trở thành xu thời đại tầng lớp Cũng từ đó, nhu cầu tự đưa thông tin lên Internet doanh nghiệp, tổ chức hay chí cá nhân để quảng cáo, giới thiệu, phổ biến kiến thức ngày lớn Không giống Website tĩnh năm trước, Website đòi hỏi truy cập sở liệu lớn, sử dụng cơng nghệ cao có nhà cung cấp hosting đáp ứng được, mà có khơng đầy đủ tính hai giá thành thuê cao, vượt khỏi tầm với tổ chức nhỏ với mong muốn phục vụ cộng đồng Trong bạn cách để tạo Home Server nhà với chi phí chấp nhận nhà bạn dịch vụ Internet, có máy chủ tương đối mạnh mở 24/24 h Ngồi Internet, đường truyền băng thơng rộng ADSL sốt nước ta với lượng người đăng ký th bao khơng ngừng tăng cao Với phí tối đa triệu / tháng MegaVNN phí trọn gói 670 ngàn / tháng Viettel, khơng tiền điện thoại giúp cho mơ ước tự xây dựng máy chủ Web trở thành thực Giờ đây, với 10 USD thuê tên miền (domain) năm, bạn biến máy tính mạnh thành Web Hosting với khả tự cấu hình bảo mật, cài đặt chương trình Web Server yêu thích sử dụng ngơn ngữ Web sở trường Điều kiện tối thiểu Máy tính cấu hình tương đối cao, tối thiểu phải CPU P4 2,4GHz HT, ổ cứng 80GB (nên sử dụng RAID cho an toàn), 512MB RAM Cài đặt hệ điều hành Windows (nên từ XP trở lên Server tốt), Macintosh, Linux, Unix Cài đặt tối thiểu Web Server, gồm: IIS, Apache, JRun Nếu có nhu cầu cài thêm hệ quản trị sở liệu như: SQL Server, MySQL Một nhiều kết nối ADSL quan trọng modem / router ADSL phải có chức tạo máy chủ ảo Virtual Server Hiểu thêm Port forwarding trước cài đặt home server Ports: Các ứng dụng chạy giao thức TCP/IP mở kết nối tới máy tính khác sử dụng port Port cho phép nhiều ứng dụng tồn máy tính đơn - tất giao tiếp với qua giao thức TCP/IP Các port tập hợp số , đứng sau địa IP Các ứng dụng thường ẩn port để giảm tính phức tạp giao thức TCP/IP Ví dụ: dịch vụ HTTP tồn port mặc định port 80 Để tìm kiếm website, ta gõ vào browser http://www.homenethelp.com:80 Port 80 port mặc định cho giao thức HTTP khơng cần thiết phải gõ vào Có tất 65535 port sẵn có Port Forwarding: Các router ứng dụng NAT khác (chẳng hạn ICS) tạo firewall mạng bạn mạng internet Một firewall giữ lại lưu lượng không mong muốn từ mạng internet vào mạng LAN bạn Một đường hầm (tunnel) tạo xuyên qua firewall bạn máy tính mạng Internet giao tiếp với máy tính mạng LAN bạn thông qua port đơn Điều thuận tiện cho việc chạy Web server, game server, ftp server, chí video conferencing Việc tạo tunnel gọi Port Forwarding Một số máy tính bạn chạy web server (port 80) máy tính khác chạy ftp server (port 23) địa IP Port forwarding khó cấu hình cung cấp phương pháp an toàn để chạy máy chủ firewall Tóm lại port forwarding cho phép bạn chạy nhiều loại máy chủ máy tính khác mạng LAN Cấu hình modem / router: Trước tiên bạn cần vào trang cấu hình modem với tài khoản quản trị (admin) Port forwarding for the Connexant: Bạn mở trình duyệt Web lên truy cập vào đường dẫn http://10.0.0.2 (giá trị mặc định bạn chưa thay đổi) Nhập admin vào ô User name mật vào ô Password (mặc định picrouter, khơng tìm thấy mật xác thử liên hệ với người cài đặt ADSL cho bạn) nhấn nút OK Trong khung bên trái, nhấp liên kết Virtual Server thuộc nhóm Configuration Vùng bên phải trang Virtual Server Configuration, bạn cần ý điểm sau: - Public Port: mang giá trị cổng (port) liệu mà bên muốn truy cập vào server Nhập 80 (port Web chuẩn) - Private Port: mang giá trị cổng thật server, liệu bên ngồi truy cập vào máy bạn thơng qua Public Port modem ánh xạ sang Private Port truyền vào server Nhập 80 - Port Type: kiểu liệu truyền / nhận Public Port Private Port Nếu liệu trang Web tập tin liệu chọn TCP, cịn bạn muốn xây dựng Website cho nghe nhạc / xem phim trực tuyến phải chọn UDP Chọn TCP - Host IP Address: địa máy tính dùng làm Web Server Đây phải địa IP tĩnh địa mạng nội bạn Ví dụ: nhập địa 10.0.0.10 Bây giờ, nhấn nút Add This Setting Tiếp tục làm thêm lần với Public Port: 254, Private Port: 1234, Port Type: TCP Host IP Address: 127.0.0.1 để khắc phục lỗi khơi phục cấu hình mặc định modem dùng chip Connexant Do ta sử dụng port 80 cho việc nhận liệu từ bên gửi đến Web Server nên phải chọn port khác cho trang cấu hình modem (vì trang Web nên sử dụng port 80) Vì vậy, nhấp liên kết Misc Configuration nhóm Admin Privilege để chuyển đến trang Miscellaneous Configuration Nhập giá trị khác 80 vào HTTP server port (ví dụ: 8080 port thường sử dụng để thay cho port 80) nhấn nút Submit cuối trang Vẫn chưa xong, bạn cần chuyển sang khung bên trái trang cấu hình nhấp liên kết LAN thuộc nhóm Configuration đến trang LAN Configuration, bỏ đánh dấu DHCP Server (tắt chức tự động cấp phát địa IP modem) chọn mục System Allocated bên Nhấn nút Submit cuối trang Cuối cùng, tìm nhấp liên kết Save Settings thuộc nhóm Configuration khung trái, nhấn nút Submit để lưu thiết lập vừa thay đổi khởi động lại modem Port forwarding for the Alcatel SpeedTouch Bước 1: Để cấu hình portforwarding cho router máy tính bạn cần có địa IP tĩnh Bước 2: Mở giao diện Web browse chẳng hạn Internet explore Netscape Gõ địa IP router vào address Theo mặc định địa IP router 10.0.0.138 Bước 3: Ngay sau bạn kết nối vào router bạn quan sát thấy Click chuột vào nút NAPT Bước 4: Trong bảng NAPT setting click chuột vào nút New Bước 5: Router cho phép bạn chuyển tiếp port thời điểm Cần phải thời gian chuẩn bị để chuyển tiếp port bạn phải chuyển tiếp vùng port Chọn giao thức cho port mà bạn muốn chuyển tiếp sử dụng cuộn Protocol Gõ số hiệu port mà bạn muốn chuyển tiếp vào hai hộp thoại Inside port Outsite port Gõ vào địa IP mà bạn muốn port chuyển tiếp tới vào hộp thoại Inside IP Đây địa IP máy tính có phần mềm u cầu portforwarding Ví dụ bạn có máy chủ chạy dịch vụ Web server địa IP hộp thoại Inside IP địa máy chủ Web server Trong hộp thoại Outside IP nên thiết lập địa 0.0.0.0 trừ bạn có nhiều địa IP Hầu hết người sử dụng khơng có địa IP ngồi Nếu bạn có nhiều địa IP ngồi bạn nhập số địa vào hộp thoại Outside IP Click vào nút Apply Bây bạn quan sát thấy cấu hình vừa tạo bảng Port forwarding for the SmartAT MX 800 Bước 1: Để thiết lập port foarding cho loại router máy tính bạn cần có địa IP tĩnh Bước 2: Bật giao diện Web browse, chẳng hạn Internet explore Netscape Gõ địa IP router vào trường address bar Theo mặc định địa IP thường thiết lập 192.168.1.1 Bước 3: Gõ vào Username Password để kết nối vào router Theo mặc định username admin password admin Sau loggin vào bạn quan sát thấy menu sau: Bước 4: Trong menu bên trái click vào dấu cộng trước Other Settings Một danh sách xuất hiện, click chuột vào link NAT Bước 5: Click chuột vào nút Add để bổ sung rule Bước 6: Trong mục rule type chọn Redirect Trong trường Protocol lựa chọn giao thức cho port forwarding Nếu cần phải lựa chọn hai phải tạo cấu hình thứ hai cho giao thức thứ hai Trong mục Local IP gõ vào địa IP để chuyển tiếp port tới Đây địa IP máy tính có phần mềm u cầu portforwarding Ví dụ bạn có máy chủ chạy dịch vụ Web server địa IP hộp thoại Local IP địa máy chủ Web server Trong trường Global Address From trường Global Address To nên gõ vào số Trong trường Destination Port From Destination Port To chọn Any other port Nếu bạn chuyển tiếp tới port đơn, đánh số port vào Destination Port From Destination Port To Nếu bạn chuyển tiếp vùng port, đánh số port nhỏ vùng vào trường Destination Port From Sau đánh số port lớn vùng vào Destination Port To Click vào Submit để kết thúc trình cấu hình Bước 7: Trong menu bên trái hình click vào link Advanced Function Trong link Advanced Function có menu con, click vào link IP Filter Nhấp chọn Use the following IP address nhập giá trị 10.0.0.10 cho ô IP address, 255.0.0.0 cho ô Subnet mask địa IP modem 10.0.0.2 cho ô Default gateway Nhấn OK Đăng ký dịch vụ Internet IP Thơng thường, để giảm chi phí, người dùng (thậm chí không) đăng ký sử dụng địa IP tĩnh nhà cung cấp dịch vụ Internet ADSL (ISP), mà khơng có IP tĩnh bạn khơng thể xây dựng Web Server địa IP động ISP cung cấp tự động bị đổi sau vài ngày (có vài giờ) Trong trường hợp này, bạn cần đăng ký dịch vụ chuyển tiếp địa IP, nhờ nó, địa IP động bạn trở nên tĩnh mà không phụ phí (nếu có thấp) Dịch vụ chuyển tiếp địa IP làm việc theo cách thức: I Dịch vụ Dynamic DNS No-ip.com Cung cấp cho người dùng tên miền (domain) trỏ tới địa IP thật modem, khách duyệt Web domain thật bạn xem địa IP tĩnh Cài đặt chương trình có chức tự động nhận biết địa Internet IP modem chuyển địa đến máy chủ máy chủ cập nhật IP cho domain chuyển tiếp Hiện có nhiều dịch vụ chuyển tiếp, bao gồm có phí miễn phí Theo kinh nghiệm sử dụng, tơi cảm thấy dịch vụ miễn phí NO-IP có tốc độ nhanh, ổn định chẳng thua dịch vụ có phí khác Trước tiên, bạn truy cập địa www.no-ip.com đăng ký tài khoản miễn phí Đăng nhập vào NO-IP tài khoản Chú ý: miễn phí nên bạn sử dụng tính Hosts / Redirects Dưới Host / Redirects (khung bên trái), nhấp Add để thêm domain mới, nhập vào ô Hostname tên domain (bạn nhập tên nhập tên domain cho dễ nhớ - ví dụ: it4viet), thơng số cịn lại giữ ngun mặc định nhấn nút Create Host Sau đó, nhấp thẻ Download phía trang Web chọn tải phiên chương trình No-IP DUC (dung lượng 619KB) tương ứng với hệ điều hành bạn sử dụng (Windows, Macintosh, Linux / Unix), cài đặt vào máy Chạy chương trình, nhập thông tin tài khoản đăng ký Website vào e-Mail Address Password, nhấn Ok Tại giao diện chương trình, bạn muốn domain làm việc đánh dấu chọn để ý biểu tượng trước tên domain Nếu màu vàng tốt, màu đỏ kết nối đến server, bạn cần kiểm tra lại đường truyền Internet phải vào trang Web www.no-ip.com xem cịn “sống” hay khơng Để Web Server bạn làm việc tốt chương trình No-IP DUC phải ln chạy để cập nhật địa IP, bạn đừng “dại” mà tắt Tuy vậy, bạn cần thiết đặt thêm số tùy chọn cho chương trình để tránh “sai lầm” đáng tiếc xảy Bạn nhấn nút Options, cửa sổ Options, chọn thẻ Standard, đánh dấu Run on startup để u cầu chương trình ln chạy khởi động, đánh dấu Run as a system service (chỉ có hiệu lực Windows 2000/XP/2003) để chương trình chạy dịch vụ hệ thống, nghĩa tự chạy trước đăng nhập không bị tắt bạn “lỡ tay” tắt chương trình Chuyển sang thẻ Connection, kéo trượt cuối trang Standard hết phía trái để quy định thời gian tự động cập nhật nhỏ (5 phút), để thời gian dài, bạn lợi băng thơng thời gian “chết” Website chuyển đổi IP lâu Cuối nhấn Ok II Dịch vụ Dynamic DNS homeip.net (nên dùng home-ip.net có tính ổn định security cao) Đầu tiên bạn vào trang chủ homeip.net , đăng kí lấy cho account để sử dụng dịch vụ Dynamic DNS ( Free) Sau bạn đăng kí xong nhận email thông báo thông tin account Bạn đăng nhập với tên user pass mà bạn đăng kí: Sau bạn phần My Account ->> My Services Trong phần bạn chọn Add Host Services nằm góc bên phải: Trong phần Add Host Services có dịch vụ sau: Bạn chọn Add Dynamic DNS Host, có giao diện hình sau: Hostname: bạn điền tên subdomain mà bạn muốn create, bên cạnh cịn có list domain homeip.net cung cấp free có phí Các thơng cịn lại bạn giữ nguyên, đánh dấu check vào Enable Wildcard Sau nhấn nút Add Host để hồn tất qúa trình Sau bạn cấu hình xong, bạn vào phần Support nằm phía Bạn thấy Client Support, bạn chọn Download Update Clients sau download DynDNS Updater (1.12MB), chương trình có chức tương tự NO-IP DUC Sau bạn Setup xong DynDNS Updater, có biểu tưởng chương trình nằm Taskbar Bạn double click vào icon chương trình: Sau bạn Settings Groups Đến bạn chọn Add, sau điền tên group vào (đặt tuỳ bạn, vd: server) Bước kế tiếp, bạn đánh Username Password tài khoản mà bạn đăng kí homeip.net, sau lại chọn Add tiếp, đánh tên domain mà bạn tạo homeip.net (VD: tạo cái: hieupc.homeip.net) Cuối bạn: click nút download check vào hieupc.homeip.net Sau click OK Settings Connections : bạn chọn Local Area Network Settings Ip Address : chọn Use default setting bạn click Detect My IP, phần lại bạn giữ nguyên edit lại theo ý muốn Sau click Okie Khi khỏi Settings, bạn vào Options giao diện : chọn Start with Windows Enabled Automatic Update (Để update IP cho bạn) Sau bạn click OK Finish Chú ý: bạn thấy icon màu xanh tốt icon màu vàng, màu đỏ bạn nên kiểm tra Phải ln kiểm tra chương trình có chạy Taskbar Cấu hình domain thật Đến thật bạn hồn thành xong quy trình xây dựng Web Server rồi, nhiên, đôi lúc domain NO-IP cung cấp không làm hài lịng bạn khơng làm hài lịng khách viếng thăm Website khó nhớ, dài dịng khơng mang tính chun nghiệp Nếu thế, bạn tự th cho domain ưng ý (giá khoảng 10 USD / năm) cho domain chuyển tiếp sang domain NO-IP Để cấu hình chuyển tiếp, bạn đăng nhập vào trang cấu hình domain, nhấp liên kết Nameservers nhóm View/Modify Tại trang DNS Information, chọn Our NameServers nhấn nút MODIFY Chuyển đến trang đầu tiên, xuất thêm nhóm Host Bạn xóa hết giá trị cũ cần nhập vào hai dòng: - Hostname: *, Address: tên domain NO-IP cung cấp, Record Type: URL Redirect, MX Pref: 10 - Hostname: www, Address: tên domain NO-IP cung cấp, Record Type: URL Redirect, MX Pref: 10 Nhập xong, nhấn nút MODIFY cuối trang Quá trình cấu hình domain xong bạn cần phải chờ thêm khoảng 24 sau sử dụng chức chuyển tiếp đợi máy chủ DNS cập nhật cache Cấu hình chương trình Web Server Đến đây, cơng việc cấu hình quan trọng nặng nhọc xong, việc cịn lại cài đặt cấu hình cho chương trình Web Server máy chủ 10.0.0.10 làm việc tốt, với ngơn ngữ Web u thích PHP, JSP, ASP, ASP.NET, ColdFusion, Flex cài đặt bảo mật không bị hack Thử truy cập Website từ máy Web Server Sau hồn thành Website, bạn đứng máy Web Server để truy cập vào Website đặt máy thông qua tên domain NO-IP Home-IP cung cấp tên domain thật Bởi lý đơn giản: bạn khơng thể tự nhìn thấy mặt trừ bạn soi gương, gương đường truyền Internet khác proxy Để có proxy, bạn truy cập trang www.stayinvisible.com/index.pl/proxy_list http://www.publicproxyservers.com/index.html , chọn cho proxy vào menu Tools trình duyệt Internet Explorer, chọn mục Internet Options, thẻ Connection, nhấn nút LAN Settings, đánh dấu Use a proxy server for your LAN, nhập địa proxy gồm IP Address Port vào hai ô tương ứng Nhấn OK Lưu ý: Nếu sau nhập proxy mà truy cập vào trang có nghĩa proxy khơng cịn sử dụng Việt Nam, bạn cần phải chọn proxy khác thay Bạn nên kiểm tra Proxy cịn live hay khơng trang sau: http://rrdb.org http://www.checker.freeproxy.ru/checker/ Đến phần cấu hình Home Server support : ASP, PHP, MySQL… Phần mềm dùng là: XAMPP, chương trình mà dùng cảm thấy good đảm bảm secure (chấp nhận được) Các bạn download XAMPP ở: http://www.apachefriends.org/en/xamppwindows.html , ngồi cịn có nhiều Add-ons bạn download nêú muốn Host bạn support nhiều Cách cài đặt cấu hình hồn Home Server với đầy đủ tính bảo mật ổn định: Method A: "Installation" with installer Of course, you can use the install wizard for the XAMPP setup That is the easiest way to install xampp correctly There for you need the main packages like xampp-win32-1.4.xxinstaller.exe The install wizard of XAMPP win32 After complete the installation, you will find XAMPP under Start / Programs / XAMPP Execute here or over your desktop the XAMPP Control Panel With that panel, you can start/stop all server And you can install/uninstall services The XAMPP control panel for start/stop Apache, MySQL, FilaZilla & Mercury or install these server as services Method B: "Installation" without Installer Without installer, download and unzip the 7-zip or zip archives into the folder of your choice The selfextracting 7-ZIP archive is very cood compressed In this case, we unpack XAMPP to D:\program files for a 'D:\program files\xampp' folder After that, open the xampp main directory and execute here the "setupxampp.bat" Now all paths in the configuration files are updated Finally start the different server with the existing start/stop batches or use the GUI "xampp-control.exe" The "setup_xampp.bat" will configure XAMPP I want to start the software immediately! If you extract XAMPP in a top level folder like c:\xampp or d:\xampp ect., you can try to start XAMPP directly That means you not need to execute the "setup_xampp.bat" before Apache, MySQL and Mercury Mail server will start up correctly! Only the FileZilla FTP server will not running because it requires absolute paths For these method please note: Do not use a double-xampp-folder like c:\xampp\xampp! You need a singlexampp folder like d:\xampp(\apache and so on) Or even you must take the "setupxampp.bat" before start up The XAMPP directory as a top level folder for a directly install/start method Practice 1: Start, stop & test XAMPP The universal control center is the XAMPP Control from von www.nat32.com (Not include in the lite version) $path-to-xampp\xampp\xampp-control.exe Thank you for this fine tool! Some more server scripts: Apache & MySQL start: $path-to-xampp\xampp\xampp_start.exe Apache & MySQL stop: $path-to-xampp\xampp\xampp_stop.exe Apache start: $path-to-xampp\xampp\apache_start.bat Apache stop: $path-to-xampp\xampp\apache_start.bat MySQL start: $path-to-xampp\xampp\apache_start.bat MySQL stop: $path-to-xampp\xampp\apache_stop.bat Mercury Mailserver start: $path-to-xampp\xampp\mercury_start.bat (Mercury only GUI Stop with GUI) FileZilla Server setup: $path-to-xampp\xampp\filezilla_setup.bat FileZilla Server start: $path-to-xampp\xampp\filezilla_start.bat FileZilla Server stop: $path-to-xampp\xampp\filezilla_stop.bat Test: After apache start open the URL http://localhost or http://127.0.0 and examine all the xampp examples and tools Practice 2: Installing the particular server as service You can install the particular server as service under these platforms: NT 4, 2000 and XP You can use these scripts: Apache Dienst install: $pfad-zum-xampp\xampp\apache\apache_installservice.bat Apache Dienst uninstall: $pfad-zum-xampp\xampp\apache\apache_uninstallservice.bat MySQL Dienst install: $pfad-zum-xampp\xampp\mysql\mysql_installservice.bat MySQL Dienst uninstall: $pfad-zum-xampp\xampp\mysql\mysql_uninstallservice.bat FileZilla Dienst (un)install: $pfad-zum-xampp\xampp\filezilla_setup.bat Mercury: No service installation available! Practice 3: Installation additionally Addons Many additional addons exist for the development with the main package At the moment, the official addons for win32 from this side are: • • • • Perl Addon with Mod_Perl and a selection important Perl Modules Tomcat Addon (Requirement: SUN J2SE SDK must already be installed) Cocoon for Tomcat Addon (Requirement: Tomcat Addon must already be installed) Python Addon The recommended rule for the installation is called: The XAMPP Installer version needs the Installer Addon, the ZIP (7-Zip) package needs the ZIP (7-Zip) Addon For the ZIP Addon please unpack the package into the XAMPP main directory directly Afterwards execute the "setup_xampp.bat" That's all And the Installer Addon package makes everything automatically Here is nothing to Note: Everyone can build a new XAMPP Addon for his project For example you will find some other addons for XAMPP at http://sourceforge.net/projects/xamppaddon Practice 4: The XAMPP Upgrades With all new releases we will publish new upgrades to bring XAMPP up to date However, sometimes some developments are not compatible to our last release and so we cannot upgrade these elements Usually we are able to update all servers and programms in XAMPP NOT the configuration files because you could have modified Tip: If you have the installer version it is more easy to use the installer upgrade All other people should take the (7-)ZIP archive Extract that package in the XAMPP folder directly and overwrite the older files Removing Method A: The zip & 7-zip package The uninstall depends on the XAMPP variant you are using • • • ZIP archive Self-extracting ZIP archive XAMPP lite version To uninstall XAMPP simply delete the package completely There are no registry entries, no environment variables simply good, clean code! But before not forget to shutdown all XAMPP server, exit all panels Perhaps, you run some services with XAMPP? Then you must install these services! Removing Method B: The install shield version For the uninstallation XAMPP in the INSTALLER version (NSI) please use the UNINSTALLER! The UNINSTALLER delete all XAMPP entries from your registry And will uninstall some installed services with this software We recommend to work with the UNSTALL software for removing the XAMPP install shield version! Question 1: What means the lite version of XAMPP? The XAMPP lite (means 'leight') is the smaller bundle of XAMPP recommendable for a quick work around with PHP and MySQL In contrast to the large package some server or tools like Mercury Mail or FileZila FTP are missing here Note: Install shield versions, add-ons or upgrades not exist for the lite version Question 2: Where should i place my web docs? The main folder for all www documents called htdocs ($path-to-xampp\xampp\htdocs) If you put a test.html file here you can show it at http://localhost/test.html with your own apache Make the same procedure with all php or cgi files For another WWW subfolder simply create one new folder in the htdocs directory For example the folder $path-toxampp\xampp\htdocs\new with the test.html Then enter the URLL http://localhost/new/test.html to show this site in your browser Further file characteristics in the overview: • • • • • • • CGI) Executable: Overall, Allowed endings: cgi => base package PHP) Executable: Overall, Allowed endings: php php4 php3 phtml => base package MOD Perl) Executable: $path-to-xampp\xampp\htdocs\modperl, Allowed endings: pl => Perl addon ASP Perl) Executable: $path-to-xampp\xampp\htdocs\modperlasp, Allowed endings: asp => Perl Addon JSP Java) Executable: $path-to-xampp\xampp\tomcat\webapps\java (u.a), Allowed endings: jsp => Tomcat addon Servlets Java) Executable: $path-to-xampp\xampp\tomcat\webapps\java (u.a), Allowed endings: html (u.a) => Tomcat addon MOD Python) Executable: $path-to-xampp\xampp\htdocs\python, Allowed endings: py => Python addon Spyce Python) Executable: $path-toxampp\xampp\htdocs\python, Allowed endings: spy => Python addon Question 3: Can i shift XAMPP? Yes, but only the XAMPP as ZIP (z-zip) archiv After shifting you must execute the "setupxampp" to adapt all configuration files Please not try that with the install shield version In this case you can make a copy of XAMPP and put this in a directory somewhere At last execute the "setup-xampp" and make your tests Try it out Question 4: How can i generate "automatic start sites"? If you browse to a folder like http://localhost/xampp/ the Apache server will return a start site automatically The Apache look for an already existing index site like index.php Responsible for this is the "DirectoryIndex" directive in the httpd.conf Here you can define the name and the arrangement for your start sites As default in XAMPP the "DirectoryIndex" directive lists as follows: index.php index.php4 index.php3 index.cgi index.pl index.html index.htm index.html.var index.phtml Question 5: How can i switch between PHP5 and PHP4 and back? XAMPP (not lite!) contains actually PHP5 and PHP4 To switch between the versions please use the "php-switch.bat" ($path-to-xampp\xampp\php-switch.bat) NOTE: Therefore, the Apache server must be stopped Question 6: Where can I change the configuration? You adjust XAMPP with (classic text) configuration files The following files exist: • Apache basic configuration: $path-to-xampp\xampp\apache\conf\httpd.conf • • • • • • • • • • Apache SSL: $path-to-xampp\xampp\apache\conf\ssl.conf Apache Perl (only addon): $path-to-xampp\xampp\apache\conf\perl.conf Apache Tomcat (only addon): $path-to-xampp\xampp\apache\conf\java.conf Apache Python (only addon): $path-to-xampp\xampp\apache\conf\python.conf PHP: $path-to-xampp\xampp\apache\conf\php.ini (with the apache actual running php version) MySQL: $path-to-xampp\xampp\mysql\bin\my.cnf phpMyAdmin: $path-to-xampp\xampp\phpMyAdmin\config.inc.php FileZilla FTP: $path-to-xampp\xampp\FileZillaFTP\FileZilla Server.xml Mercury Mail basic configuration: $path-to-xampp\xampp\MercuryMail\MERCURY.INI Sendmail: $path-to-xampp\xampp\sendmail\sendmail.ini Question 7: Do I have to go online to work with XAMPP? No! You can work "offline" with XAMPP Question 8: Where is what? Directory Content \xampp\anonymous Anonymous FTP example folder \xampp\apache Apache server directory \xampp\cgi-bin Dir for executing cgi scripts \xampp\FileZillaFTP FileZilla FTP server directory \xampp\htdocs Main http docs directory \xampp\install For Setup XAMPP (do not delete!) \xampp\licenses Dito \xampp\MercuryMail Mercury Mail SMTP POP3 IMAP server dir \xampp\mysql MySQL server directory \xampp\perl Perl directory \xampp\php PHP (4+5) directory \xampp\phpmyadmin phpMyAdmin directory \xampp\security Extra directory for security configs \xampp\tmp The temporary folder \xampp\webalizer Webalizer web statistic directory \xampp\webdav WebDAV Authoring example folder A matter of security (A MUST READ!) As mentioned before, XAMPP is not meant for production use but only for developers in a development environment The way XAMPP is configured is to be open as possible and allowing the developer anything he/she wants For development environments this is great but in a production environment it could be fatal Here a list of missing security in XAMPP: The MySQL administrator (root) has no password The MySQL daemon is accessible via network PhpMyAdmin is accessible via network Examples are accessible via network To fix most of the security weaknesses simply call the following URL: http://127.0.0.1/xampp/xamppsecurity.php The root password for MySQL+PhpMyAdmin and also a XAMPP directory protection can being established here Addendum 1: XAMPP and services For all NT/2000 users, in both packages you will find the install and uninstall files to build all servers as services in the respective directories • • • • apache_installservice.bat => Apache install as service/li> apache_uninstallservice.bat => Apache uninstall as service mysql_installservice.bat => MySQL install as service mysql_uninstallservice.bat => MySQL uninstall as service After all changes don't forget to restart your system Note! To uninstall the mysql service you must first of all have stopped the mysql service! Addendum 2: MySQL and PHP MySQL starts without a password for "root" So in PHP you can connect the MySQLServer with: mysql_connect("localhost","root",""); If you want to set a password for "root" in MySQL, please use "mysqladmin" under Console For example: \ \xampp\mysql\bin\mysqladmin -u root password secret Attention After changing the password for root, don't forget to inform PHPMyAdmin Search the "config.inc.php" under \ \xampp\phpmyadmin\ and edit the following lines: $cfg['Servers'][$i]['user'] = 'root'; // MySQL SuperUser $cfg['Servers'][$i]['auth_type'] = 'http'; // HTTP MySQL authentification Now the correct password for "root" is required, before PHPMyAdmin starts ... cho việc chạy Web server, game server, ftp server, chí video conferencing Việc tạo tunnel gọi Port Forwarding Một số máy tính bạn chạy web server (port 80) máy tính khác chạy ftp server (port... Flex cài đặt bảo mật không bị hack Thử truy cập Website từ máy Web Server Sau hồn thành Website, bạn khơng thể đứng máy Web Server để truy cập vào Website đặt máy thông qua tên domain NO-IP Home-IP... Apply để ghi lại cấu hình Cấu hình máy chủ Web Server Do bạn đặt địa Web Server modem ADSL 10.0.0.10 nên cần phải thay đổi địa IP động máy dùng làm Web Server thành địa IP tĩnh 10.0.0.10 Bạn vào

Ngày đăng: 16/08/2012, 08:55

Hình ảnh liên quan

Portforwarding có thể khó cấu hình nhưng nó cung cấp một phương pháp an toàn để - Tự xây dưng web server

ortforwarding.

có thể khó cấu hình nhưng nó cung cấp một phương pháp an toàn để Xem tại trang 3 của tài liệu.
Cấu hình mode m/ router: - Tự xây dưng web server

u.

hình mode m/ router: Xem tại trang 3 của tài liệu.
Vẫn chưa xong, bạn cần chuyển sang khung bên trái của trang cấu hình và nhấp liên kết LAN thuộc nhóm Configuration đến trang LAN Configuration, bỏđánh dấu DHCP  Server (tắt chức năng tựđộng cấp phát địa chỉ IP của modem) và chọn mục System  Allocated bên  - Tự xây dưng web server

n.

chưa xong, bạn cần chuyển sang khung bên trái của trang cấu hình và nhấp liên kết LAN thuộc nhóm Configuration đến trang LAN Configuration, bỏđánh dấu DHCP Server (tắt chức năng tựđộng cấp phát địa chỉ IP của modem) và chọn mục System Allocated bên Xem tại trang 5 của tài liệu.
Bước 4: Trong bảng NAPT setting click chuột vào nút New.     - Tự xây dưng web server

c.

4: Trong bảng NAPT setting click chuột vào nút New. Xem tại trang 6 của tài liệu.
Bước 3: Ngay sau khi bạn kết nối vào router bạn sẽ quan sát thấy màn hình như trên. Click chuột vào nút NAPT - Tự xây dưng web server

c.

3: Ngay sau khi bạn kết nối vào router bạn sẽ quan sát thấy màn hình như trên. Click chuột vào nút NAPT Xem tại trang 6 của tài liệu.
Outside IP. Click vào nút Apply. Bây giờ bạn sẽ quan sát thấy cấu hình vừa được tạo ra trong bảng trên - Tự xây dưng web server

utside.

IP. Click vào nút Apply. Bây giờ bạn sẽ quan sát thấy cấu hình vừa được tạo ra trong bảng trên Xem tại trang 7 của tài liệu.
kết thúc quá trình cấu hình này. - Tự xây dưng web server

k.

ết thúc quá trình cấu hình này Xem tại trang 10 của tài liệu.
Bước 4: Trên menu bên trái màn hình click chuột vào link Virtual Server. - Tự xây dưng web server

c.

4: Trên menu bên trái màn hình click chuột vào link Virtual Server Xem tại trang 13 của tài liệu.
Bước 1: Để có thể cấu hình Portforwarding cho router ADSL thì máy tính của bạn phải có địa chỉ IP tĩnh. - Tự xây dưng web server

c.

1: Để có thể cấu hình Portforwarding cho router ADSL thì máy tính của bạn phải có địa chỉ IP tĩnh Xem tại trang 14 của tài liệu.
5. Portforwarding for ZOOM X4 - Tự xây dưng web server

5..

Portforwarding for ZOOM X4 Xem tại trang 14 của tài liệu.
Flavor chọn RDR thì menu có hình như trên. Điền số thứ tự vào Rule ID, số này là duy - Tự xây dưng web server

lavor.

chọn RDR thì menu có hình như trên. Điền số thứ tự vào Rule ID, số này là duy Xem tại trang 17 của tài liệu.
để cấu hình các thông số cho portforwarding. - Tự xây dưng web server

c.

ấu hình các thông số cho portforwarding Xem tại trang 21 của tài liệu.
Bước 7: Click vào nút Add This Settings để bổ sung cấu hình vào bảng trên. Sau đấy click vàp nút Write Settings to Flash and Rebootđể ghi lại cấu hình vừa thiết lậ p và  - Tự xây dưng web server

c.

7: Click vào nút Add This Settings để bổ sung cấu hình vào bảng trên. Sau đấy click vàp nút Write Settings to Flash and Rebootđể ghi lại cấu hình vừa thiết lậ p và Xem tại trang 22 của tài liệu.
Bước 4: Click chuột vào NAT giữa màn hình bạn sẽ quan sát thấy menu sau: - Tự xây dưng web server

c.

4: Click chuột vào NAT giữa màn hình bạn sẽ quan sát thấy menu sau: Xem tại trang 24 của tài liệu.
Bước 7: Click vào nút Save để ghi lại cấu hình vừa thiết lập. Sau đó bạn sẽ quay trở lại menu NAT Settings - Tự xây dưng web server

c.

7: Click vào nút Save để ghi lại cấu hình vừa thiết lập. Sau đó bạn sẽ quay trở lại menu NAT Settings Xem tại trang 25 của tài liệu.
Cấu hình máy chủ Web Server - Tự xây dưng web server

u.

hình máy chủ Web Server Xem tại trang 27 của tài liệu.
Sau khi bạn đã cấu hình xong, bạn vào phần Support nằ mở phía trên - Tự xây dưng web server

au.

khi bạn đã cấu hình xong, bạn vào phần Support nằ mở phía trên Xem tại trang 31 của tài liệu.
Bạn chọn Add Dynamic DNS Host, có giao diện như hình sau: - Tự xây dưng web server

n.

chọn Add Dynamic DNS Host, có giao diện như hình sau: Xem tại trang 31 của tài liệu.
Cấu hình domain thật - Tự xây dưng web server

u.

hình domain thật Xem tại trang 33 của tài liệu.
Đến phần cấu hình 1 Home Server suppor t: ASP, PHP, MySQL…. - Tự xây dưng web server

n.

phần cấu hình 1 Home Server suppor t: ASP, PHP, MySQL… Xem tại trang 34 của tài liệu.

Từ khóa liên quan

Tài liệu cùng người dùng

Tài liệu liên quan