配置Apache HTTP服务器为Eclipse [英] Config Apache HTTP Server for Eclipse

查看:1470
本文介绍了配置Apache HTTP服务器为Eclipse的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

也许这问题是愚蠢的,但我真的不知道该如何解决。

Maybe this question is silly but I really don't know how to solve.

首先,作为其他服务器,我想定义新的服务器。所以,在Eclipse中,我去:WINDOWS> preference>服务器:

First, as other server, I want to define new server. So, in Eclipse, I go to: Windows>Preference>Server:

1)当我添加新的服务器,在列表中,没有任何类别的Apache HTTP服务器。只是有Apache Tomcat上。所以,我点击进入下载额外的服务器适配器 - >仍在名单没有

1) When I add new server, in list, no category for Apache HTTP server. Just has Apache Tomcat. So, I click into download additional server adapter-->still don't have in list.

2)所以,我搜索。我点我已经安装位置。好,Eclipse可以说是一个HTTP服务器。和Eclipse看到文件夹,把项目转化为我(因为我用灯,使文件夹不是在Apache的文件夹)。

2) So, I search. I point to location I have installed. Good, Eclipse sees that is a HTTP Server. And Eclipse sees folder to put project into for me (because I use LAMP so that folder isn't in Apache folder).

但这里是我的问题。当我想运行一个新的PHP项目。点击右键,在服务器上运行。一个新的对话框出现带我去选择要运行的服务器。而且,在服务器列表,没有HTTP服务器,所以,我不知道该如何选择Apache HTTP服务器! (因为Eclipse不看,我已经定义了服务器,日食只要找到适配器第一)

But here is my problem. When I want to run a new PHP Project. Right click, run on server. A new dialog appear take me to choose which server to run. And, in list of server, no HTTP Server, So, I don't know how to choose Apache HTTP Server !!! (because Eclipse doesn't see which server that I have defined, eclipse just find adapter first)

所以,如果我要运行这个项目,我必须复制所有并粘贴到Apache文件夹中。太方便!

So, if I want to run this project, I must copy all and paste to Apache folder. Too handy !!!

请帮我。

感谢:)

推荐答案

Apache的HTTP服务器和Eclipse不互相沟通。 Windows下的服务器 - > preference - >服务器是如Tomcat和Glassfish的Java服务器

Apache's HTTP server and Eclipse don't communicate with each other. The servers under Windows -> Preference -> Server are Java servers like Tomcat and Glassfish.

您需要做的就是定义在Eclipse Web项目,然后定义相同的目录在httpd.conf文件的HTTP服务器。或者,因为你已经设置了写在Eclipse的Ant脚本到PHP文件复制到你的HTTP文件夹中。

What you need to do is define your web project in Eclipse, then define that same directory to the HTTP server in the httpd.conf file. Or, since you're already set up, write an Ant script in Eclipse to copy the PHP files to your HTTP folder.

编辑补充:这是我的Ant脚本来保持我的Eclipse目录并同步我的HTTP目录。我开发在Windows中。

Edited to add: Here's my Ant script to keep my Eclipse directory and my HTTP directory synchronized. I develop in Windows.

<?xml version="1.0" encoding="UTF-8"?>
<project name="build" default="" basedir=".">
    <description>
       Synchronize the Eclipse folders and the web site folders
    </description>    
    <!-- Relative location of eclipse folder -->
    <property name="eclipse" value="." />
    <!-- Absolute location of web site folder -->
    <property name="website" value="C:/Presbury UMC/" />

    <!-- Copy new web site files -->
    <copy todir="${eclipse}">
        <fileset file="${website}/index.php"/>
    </copy>
    <copy todir="${eclipse}/css">
        <fileset dir="${website}/css"/>
    </copy>
    <copy todir="${eclipse}/images">
        <fileset dir="${website}/images"/>
    </copy>
    <copy todir="${eclipse}/protected">
        <fileset dir="${website}/protected/">
            <exclude name="yiic*"/>
            <exclude name=".htaccess"/>
        </fileset>
    </copy>   
    <copy todir="${eclipse}/themes">
        <fileset dir="${website}/themes"/>
    </copy>

    <!-- Copy new Eclipse files -->
    <copy todir="${website}">
        <fileset file="${eclipse}/index.php"/>
    </copy>
    <copy todir="${website}/css">
        <fileset dir="${eclipse}/css"/>
    </copy>
    <copy todir="${website}/images">
        <fileset dir="${eclipse}/images"/>
    </copy>
    <copy todir="${website}/protected">
        <fileset dir="${eclipse}/protected/"/>
    </copy>   
    <copy todir="${website}/themes">
           <fileset dir="${eclipse}/themes/"/>
    </copy>   
</project>

这篇关于配置Apache HTTP服务器为Eclipse的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆