localhost

mac攻略(三) -- apache站点配置

放肆的年华 提交于 2020-01-06 08:48:26
Mac OS X 中默认有两个目录可以直接运行你的 Web 程序, 一个是系统级的 Web 根目录: /Library/WebServer/Documents/ 此根目录我们平常使用地址http://localhost来访问 另一个是用户级的根目录,根目录(也是站点目录)是: ~/Sites 此根目录我们常常会配置好站点,然后输入站点地址来访问 方法一 下面介绍具体的实现步骤 1.创建Sites目录(如果你的家目录下有这个目录就免了) 2.修改”你的用户名.conf”这个文件(文件位于 /etc/apache2/users/ )。 1>如果没有,那么你需要创建一个,取名为”你的用户名.conf” 2>编辑文件 sudo vi /etc/apache2/users/你的用户名.conf 然后将下面内容写到上面打开的文件中 <Directory "/Users/username/Sites/"> Options Indexes MultiViews AllowOverride All Order allow,deny Allow from all </Directory> (请将username改成你的用户名) 3>文件保存(:wq)之后,给它赋予相应的权限: sudo chmod 755 /etc/apache2/users/你的用户名.conf

KONG -- 配置 service 并添加 key-auth

二次信任 提交于 2020-01-06 07:48:14
默认情况下, KONG 监听下面几个端口: 8000 这个端口用于监听客户端的 HTTP 请求,并转发给上游服务 8443 这个端口用于监听客户端的 HTTPS 请求,并转发给上游服务 8001 用于接收配置 KONG 的 Admin API 8444 功能同 8001,只是这个端口接收的是 HTTPS 请求 普通服务: 1. 为 http://mockbin.org 添加一个名为 example-service 的服务。 $ curl -i -X POST \ --url http://localhost:8001/services/ \ --data 'name=example-service' \ --data 'url=http://mockbin.org' 2. 为上面创建的服务添加一个路由 $ curl -i -X POST \ --url http://localhost:8001/services/example-service/routes \ --data 'hosts[]=example.com' 这样就配置完成了一个代理服务,通过访问 KONG 的 example.com ,KONG 会把请求转发到 http://mockbin.org。 注意: /services/ 后面的 example-service 需要和第1步中的 --data 'name='

Keep getting “Proxy error: Could not proxy request” error after adding proxy to react package.json

♀尐吖头ヾ 提交于 2020-01-06 05:56:25
问题 I am following this basic guide to set up a local dev environment with both react and node running. I am stuck after adding a "proxy": "http://localhost:4001" statement to the package.json of the react directory. It keeps saying: Proxy error: Could not proxy request /flower from localhost:51427 to http://localhost:4001. Environment: There's no authentication involved. It is just a boilerplate node.js and create-react-app setup. The create-react-app version is 3.0.1. I am using a Mac. I tried

SpringCache学习之操作redis

早过忘川 提交于 2020-01-06 05:51:22
一、redis快速入门   1、redis简介   在java领域,常见的四大缓存分别是ehcache,memcached,redis,guava-cache,其中redis与其他类型缓存相比,有着得天独厚的优势: 它是基于内存的数据库,什么意思呢?由于受磁盘IO影响,它所有操作都在内存当中,用以提高性能,同时采用异步的方式将数据保存在硬盘当中。 与memcached相比,redis支持多种数据类型,string,list,set,sorted set,hash。让我们使用起来更加灵活 支持事务,操作都是原子性,所谓的原子性就是对数据的更改要么全部执行,要么全部不执行 丰富的特性:可用于缓存,消息,可以设置key的过期时间,过期后将会自动删除对应的记录 redis是单线程单进程的,它利用队列技术将并发访问变为串行访问,消除了传统数据库串行控制的开销。  2、redis常见的数据类型    2.1 redis的key:      我们可以使用任何二进制序列当我们的键,过长过短的键都不建议使用,在这里建议大家使用尝试使用一个模式。例如,“object-type:id”是一个比较推荐的方式,举个例子,我们可以这样来定义键:“user:1000”。点或破折号通常用于多字字段。    2.2 strings: 该类型是最基本的数据类型,也是最常见的数据类型。我们可以使用set 或get

By default, mobile browsers use HTTPS. How can I force mobile browers(Chrome and Firefox) to use HTTP?

橙三吉。 提交于 2020-01-06 03:48:11
问题 I have a web applicaton hosted on my laptop which does not use encryption. The site works fine when accessed from laptop browsers. When I try to access same(using IP-ADDRESS/site-name or http://IP-ADDRESS/site-name) using Firefox and Chrome from mobile, I get a warning stating that the local site is not secure. I bypassed the warning and tried to access the site but, both browsers still try to connect to the site over HTTPS and report an error that requested page does not exist. By default,

Server strtotime incorrect

时光毁灭记忆、已成空白 提交于 2020-01-06 02:14:37
问题 Both strtotime and mktime are outputting an incorrect timestamp and it's driving me mad. If I add the following strtotime('2012-10-09'); I get 1349701200 Which is actually Mon, 08 Oct 2012 13:00:00 GMT I'm using my localhost, running MAMP. I'm assuming it's a server timezone issue, or something, but I don't understand why, or how to fix it. Any help? 回答1: strtotime uses default timezone to interpret the string. If you want different timezone you could specify it explicitly or change it for

OperationalError at / attempt to write a readonly database

走远了吗. 提交于 2020-01-06 02:13:14
问题 I configured Apache with Django. For that I had to move my django app to the server root directory. Now, I'm getting an error that my database is read only. I checked permissions and they didn't change after the move. Please help. It gives me this error: OperationalError at / attempt to write a readonly database 回答1: I ran into a similar problem on a CentOS 7 system, where SELinux was running. If you have SELinux installed, you can check if it's enabled by running sestatus and possibly

问题root@localhost's password:localhost:permission denied,please try again

大兔子大兔子 提交于 2020-01-06 01:01:15
背景:在装完hadoop及jdk之后,在执行start-all.sh的时候出现 root@localhost's password:localhost:permission denied,please try again。 可是,我记得当时设置的密码是对的,无论怎么输都不对,并且url中localhost:50030和localhost:50090是可以打开的,但是各种数据都为0。 解决方法:在出现上述问题后,输入   sudo passwd 然后,会输入新的密码,设置之后,再重新格式化一下namenode,最后执行start-all.sh,OK。 web上也有数据出现了。 经过试验,上述方法在我的电脑中没有成功。 1.安装 open ssh:sudo apt-get install openssh-server 2.修改root密码:#sudo passwd root 3.辑配置文件,允许以 root 用户通过 ssh 登录:sudo vi /etc/ssh/sshd_config  找到:PermitRootLogin prohibit-password禁用 添加:PermitRootLogin yes 4.sudo service ssh restart OK,正常登录!!! 来源: https://www.cnblogs.com/hmy-blog/p/6500909

Error when trying to execute action class after hosting a java website made in struts2

谁说我不能喝 提交于 2020-01-05 23:28:14
问题 I have made a website in java struts2 and i have hosted it. Its running well but what happens is whenever i try to execute any action it gives error of 404 . when i run on any local server through eclipse everything is fine ,no error and no exceptions but after hosting it gives this error. when i run on local host its URL is ёhttp://localhost:8280/foryou/searchonbb.actionё and everything works perfectly. and when i try to execute same action online its shows URL something like this http:/

PHP error with mailserver “ Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0” in context to email

巧了我就是萌 提交于 2020-01-05 03:37:17
问题 I am setting up a localhost PHP server to play around with mailservers. I have my php.int all set up with my provider's info and have a seemingly valid php file that I am trying to run: (info changed, for obvious reasons.) <?php $to = 'example@gmail.com'; $headers = ""; $headers .= "From: WIFI Metropolis <sitename@hostname.com> \r\n"; mail ($to, string, string , $headers); ?> When navigate to this file (new.php), i get this error: Warning: Unknown: failed to open stream: No such file or