Now our lives have changed. We have iPad, iPhone, and Android on our hands.
I believe many cainiao must ask how to share media resources on their computers?
My current method:
1. Use an FTP server
Then, Android has FTP clients.
For Windows server, you can use Serv-u ftp server or the free filezilla server.
2. Use an HTTP server
For example, the simplest HFS
Official: http://www.rejetto.com/hfs? F = DL
Today, I will focus on using Apache Tomcat to create media on a website shared computer.
We need to install JDK and Apache Tomcat.
JDK: www.oracle.com/technetwork/java/javase/downloads/index.html
Tomcat:
7.0
Http://tomcat.apache.org/download-70.cgi
6.0
Http://tomcat.apache.org/download-60.cgi
Note: JDK and tomcat must be compatible.
Use Tomcat 7 for JDK 7
X86 for 32-bit windows
64-bit Windows OS x64
Apache-tomcat-7.0.16.tar. I downloaded this.
JDK is an EXE, which can be installed by double-clicking.
Apache-tomcat-7.0.16.tar directly with decompression tools such as winrardecompression can be used
Start Tomcat: Double-click
Apache-Tomcat-extract directory \ bin \ Startup. bat
Open Firefox and enter http: // localhost: 8080. If the access is normal, the operation is successful.
Stop Tomcat: Double-click
Apache-Tomcat-extract directory \ bin \ shutdown. bat
The remaining question is how to configure APACHE-Tomcat
Modify server. xml.
Add <context Path = "/myweb" docbase = "E: \ downloads"/> to the element
The specific meaning is:
<Context
Path = "/myweb"/required, indicating the name of the virtual directory: http: // localhost: 8080/myweb
Docbase = "E: \ downloads"/> absolute path of the virtual directory on the hard disk
I posted my modified parts:
<Host name="localhost" appBase="webapps" unpackWARs="true" autoDeploy="true"> <!-- SingleSignOn valve, share authentication between web applications Documentation at: /docs/config/valve.html --> <!-- <Valve className="org.apache.catalina.authenticator.SingleSignOn" /> --> <!-- Access log processes all example. Documentation at: /docs/config/valve.html Note: The pattern used is equivalent to using pattern="common" --> <Valve className="org.apache.catalina.valves.AccessLogValve" directory="logs" prefix="localhost_access_log." suffix=".txt" pattern="%h %l %u %t "%r" %s %b" resolveHosts="false"/> <Context path="/myweb" docBase="E:\Downloads" /> </Host> </Engine> </Service></Server>
Enter http: // localhost: 8080/myweb In the IE address bar to access
In fact, this will only prompt the Error 404... OTL
This is mainly for security considerations. If no default homepage exists in your directory, the file list in your directory will be leaked to others.
For configuration options, find listings in Tomcat/CONF/Web. xml.
Change false to true to solve this problem.
I posted my modified parts:
<servlet> <servlet-name>default</servlet-name> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class> <init-param> <param-name>debug</param-name> <param-value>0</param-value> </init-param> <init-param> <param-name>listings</param-name> <param-value>true</param-value> </init-param> <load-on-startup>1</load-on-startup> </servlet>
The device cannot access http: // localhost: 8080/myweb.
Because localhost refers to the local machine. You must replace the IP address of your Nic.
Http: // 192.168.189.128: 8080/myweb/
OK. I have finished all of this. Learn more about tomcat configuration methods by using Baidu.
If you need to replace Tomcat with IIS express 7.5
Please read http://blog.csdn.net/luozhuang/article/details/7645662
And configure IIS express 7.5 to allow external access