【PHP】如何配置阿帕奇汤姆猫服务器?【急】
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了【PHP】如何配置阿帕奇汤姆猫服务器?【急】相关的知识,希望对你有一定的参考价值。
我有apacha tomcat和wamp5服务器。
我用php编程。
我需要配置服务器,完成下面这项工作:
我写一个应用放到校内上,我需要一个回调地址,是访问我的服务器获取引用内容的,回调地址的格式是这样的:
http://***.***.***.***/app/index.php
我该如何配置服务器,已达到上面这样格式可以让校内网回调我这个地址?以上两个服务器可以任选一种帮我解答,WAMP5我稍微熟悉一些,有限。
谢谢了,随时来看,一旦能配成,马上结贴。
2楼的,校内应用程序都是放在校内网以外的地方,如果要点进某个应用就要从别的网站把这个程序引用过来,有概念了么?“引用过来”就叫回调,需要一个地址,在页面的某一个部分来展现这个地址下的程序内容,这个地址就是我需要的回调,也就是你不太理解的回调地址
然后把那里的IP、端口修改成你自己的,并且那个DocumentRoot和Directory路径修改成你自己的真实路径就可以了,这里只是给一个例子
<VirtualHost 192.168.8.5:80>
ServerName ltx.navi.com
DocumentRoot "F:\work\series_navi\src\symfony_top\base\htdocs"
DirectoryIndex index.php
<Directory "F:\work\series_navi\src\symfony_top\base\htdocs">
AllowOverride All
Allow from All
</Directory>
</VirtualHost> 参考技术B 在apacha的安装目录中找到 httpd.conf或类似的.conf文件
在该文件中找到这句“DocumentRoot 。。”,如果前面有#号就把#号去掉。
例如:你的目录结构是这样(D:/server/app/index.php)
那么把上面找到的那句改成:
DocumentRoot “D:/server/”
重启服务器即可
注意(引号为英文半角的) 参考技术C 不太明白你的意思,是不是如果进入服务器地址也就是http://***.***.***.***/之后,你想回跳到http://***.***.***.***/app/index.php这个地址,
如果是这样的话,你直接在服务器的根目录下放置一个html文件,里面加上<meta http-equiv="Refresh",content="0;url="http://***.***.***.***/app/index.php">这样的话也不用去配置服务器了
不知道这样可不可以 参考技术D 你的目录结构是这样(D:/server/app/index.php)本回答被提问者采纳 第5个回答 2009-10-28 用iframe直接可以调用
ios-UI-汤姆猫德游戏实现
//
// ViewController.m
// UI-猜拳游戏
//
// Created by jzq_mac on 15/7/15.
// Copyright (c) 2015年 jzq_mac. All rights reserved.
//
#import "ViewController.h"
#define TIME 61
@interface ViewController ()
{
UILabel *timeLable;
UILabel *scoreLable;
UILabel *observeLable;
UIImageView *imgeView;
UIImageView *imgeView1;
UIButton *button;
int score;
int time;
int number;
NSTimer *timer;
NSArray *imageList;
NSArray *buttonImageList;
NSArray *faceList;
BOOL Start;
}
@end
@implementation ViewController
- (void)viewDidLoad {
[super viewDidLoad];
// 设置背景图
UIImageView *imageView = [[UIImageView alloc]initWithFrame:[UIScreen mainScreen].bounds];
imageView.image = [UIImage imageNamed:@"钱.png"];
[self.view addSubview:imageView];
imageList = @[@"石头.png",@"剪刀.png",@"布.png"];
buttonImageList = @[@"石头1.png",@"剪刀1.png",@"布1.png"];
faceList = @[@"哭.png",@"笑.png",@"挣扎.png"];
//创建笑脸视图
imgeView1 = [[UIImageView alloc]initWithFrame:CGRectMake(135, 320, 100, 100)];
imgeView1.image = [UIImage imageNamed:@"美女1.png"];
[self.view addSubview:imgeView1];
time = TIME;
// 调用视图
[self creatView];
[self flashView];
[self creatButon];
// 定时器
timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(flashView) userInfo: nil repeats:YES];
[[NSRunLoop currentRunLoop]addTimer:timer forMode:NSDefaultRunLoopMode];
timer.fireDate = [NSDate distantFuture];
timeLable.text = [NSString stringWithFormat:@"时间: %d 秒",time];
}
//创建视图
- (void)creatView
{
scoreLable = [[UILabel alloc]initWithFrame:CGRectMake(0, 20, 100, 50)];
[self.view addSubview:scoreLable];
scoreLable.text = [NSString stringWithFormat:@"得分: %d 分",score];
scoreLable.textColor = [UIColor blueColor];
scoreLable.backgroundColor = [UIColor grayColor];
scoreLable.textAlignment = NSTextAlignmentCenter;
scoreLable.alpha = 0.4;
timeLable = [[UILabel alloc]initWithFrame:CGRectMake(275, 20, 100, 50)];
[self.view addSubview:timeLable];
timeLable.backgroundColor = [UIColor grayColor];
timeLable.textColor = [UIColor blueColor];
timeLable.textAlignment = NSTextAlignmentCenter;
timeLable.text = [NSString stringWithFormat:@"时间: %d 秒",time];
timeLable.alpha = 0.4;
observeLable = [[UILabel alloc]initWithFrame:CGRectMake(0, 450, CGRectGetHeight([UIScreen mainScreen].bounds), 50)];
[self.view addSubview:observeLable];
observeLable.backgroundColor = [UIColor grayColor];
observeLable.alpha = 0.6;
// observeLable.textAlignment = NSTextAlignmentCenter;
observeLable.font = [UIFont boldSystemFontOfSize:30];
observeLable.text = @" ~~~人 机 猜 拳 大 战~~~ ";
}
//闪烁图片
- (void)flashView
{
time--;
timeLable.text = [NSString stringWithFormat:@"时间: %d 秒",time];
for (int i = 0; i < 1; i++) {
imgeView = [[UIImageView alloc]initWithFrame:CGRectMake(135 + 100*i, 80, 100, 100)];
imgeView.image = [UIImage imageNamed:@"美女.png"];
[self.view addSubview:imgeView ];
int r = arc4random()%imageList.count;
number = r;
imgeView.image = [UIImage imageNamed:imageList[r]];
}
if (time == 0) {
timer.fireDate = [NSDate distantFuture];
UIAlertView *alert = [[UIAlertView alloc]initWithTitle:@"大家一起猜" message:@"时间到" delegate:self cancelButtonTitle:nil otherButtonTitles:@"不服就再来啊", nil];
[alert show];
}
}
//创建button
- (void)creatButon
{
for (int i = 0; i < 3; i++) {
button = [[UIButton alloc]initWithFrame:CGRectMake(35 + 100*i, 200, 100, 100)];
[self.view addSubview:button];
[button setBackgroundImage:[UIImage imageNamed:buttonImageList[i]] forState:UIControlStateNormal];
button.backgroundColor = [UIColor redColor];
button.layer.cornerRadius = 50;
button.layer.masksToBounds = YES;
button.alpha = 0.6;
button.tag = i + 1;
[button addTarget:self action:@selector(selectButton:) forControlEvents:UIControlEventTouchUpInside];
}
UIButton *startButton = [[UIButton alloc]initWithFrame:CGRectMake(160, 550, 80, 80)];
[self.view addSubview:startButton];
[startButton setBackgroundImage:[UIImage imageNamed:@"開始.png"] forState:UIControlStateNormal];
[startButton setTitle:@"開始" forState:UIControlStateNormal];
[startButton setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
[startButton addTarget:self action:@selector(startGame:) forControlEvents:UIControlEventTouchUpInside];
}
//開始游戏
- (void)startGame:(UIButton *)sender
{
if (sender.selected !=YES) {
timer.fireDate = [NSDate distantPast];
[sender setTitle:@"暂停" forState:UIControlStateNormal];
sender.selected = YES;
Start = YES;
}else
{
timer.fireDate = [NSDate distantFuture];
[sender setTitle:@"開始" forState:UIControlStateNormal];
sender.selected = NO;
Start = NO;
}
}
//选择button的触发事件
- (void)selectButton:(UIButton *)sender
{
if (Start != NO) {
// sender.showsTouchWhenHighlighted = YES;
if (sender.tag == 1) {
if (number == 0) {
imgeView1.image = [UIImage imageNamed:faceList[2]];
}else if(number == 1){
imgeView1.image = [UIImage imageNamed:faceList[1]];
score ++;
scoreLable.text = [NSString stringWithFormat:@"总分: %d 分",score];
}else if (number == 2){
imgeView1.image = [UIImage imageNamed:faceList[0]];
}
}
if (sender.tag == 2) {
if (number == 0) {
imgeView1.image = [UIImage imageNamed:faceList[0]];
}else if(number == 1){
imgeView1.image = [UIImage imageNamed:faceList[2]];
}else if (number == 2){
imgeView1.image = [UIImage imageNamed:faceList[1]];
score ++;
scoreLable.text = [NSString stringWithFormat:@"总分: %d 分",score];
}
}
if (sender.tag == 3) {
if (number == 0) {
imgeView1.image = [UIImage imageNamed:faceList[1]];
score ++;
scoreLable.text = [NSString stringWithFormat:@"总分: %d 分",score];
}else if(number == 1){
imgeView1.image = [UIImage imageNamed:faceList[0]];
}else if (number == 2){
imgeView1.image = [UIImage imageNamed:faceList[2]];
}
}
}
}
//弹窗事件
- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
{
if (buttonIndex == 0) {
score = 0;
time = TIME;
scoreLable.text = [NSString stringWithFormat:@"总分: %d 分",score];
timeLable.text = [NSString stringWithFormat:@"时间:%d 秒",time];
timer.fireDate = [NSDate distantPast];
}else{
timer.fireDate = [NSDate distantPast];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
以上是关于【PHP】如何配置阿帕奇汤姆猫服务器?【急】的主要内容,如果未能解决你的问题,请参考以下文章