手机浏览 RSS 2.0 订阅 膘叔的简单人生 , 腾讯云RDS购买 | 超便宜的Vultr , 注册 | 登陆
浏览模式: 标准 | 列表分类:Linux

vagrant使用parallels desktop

 使用laravel的人,好象一直都推荐使用homestead,所以我也就尝试了一下。由于默认的vagrant都是用的virtual box,而我一直是嫌弃他繁,而且几年前耗的资源让我心有余悸,再加上我本地本来就有Parallels Desktop,所以我就找找资料,看看能不能使用parallels。

结果是出人意料的好,官方也支持,只是需要安装个插件,戳这里看一下:https://parallels.github.io/vagrant-parallels/docs/getting-started.html,几行命令行可:vagrant plugin install vagrant-parallels

然后就是初始化了,vagrant init laravel/homestead,这时候会跳出个选择,就象这样:

XML/HTML代码
  1. ==> box: Loading metadata for box 'laravel/homestead'  
  2.     box: URL: https://vagrantcloud.com/laravel/homestead  
  3. This box can work with multiple providers! The providers that it  
  4. can work with are listed below. Please review the list and choose  
  5. the provider you will be working with.  
  6.   
  7. 1) hyperv  
  8. 2) parallels  
  9. 3) virtualbox  
  10. 4) vmware_desktop  
  11.   
  12. Enter your choice: 2  
  13. ==> box: Adding box 'laravel/homestead' (v8.0.0) for provider: parallels  

 

选择2 就行了。然后就会开始下载。由于下载地址在github上面,然后实际 是在aws的S3上,痛苦的事情就这样来了。。。不爬梯子动也不动。番了墙也只有400多K,所幸,1个多小时就下载下来了。

然后vagrant up --provider=parallels,这样就好了

XML/HTML代码
  1. vagrant up --provider=parallels  
  2. /opt/vagrant/embedded/gems/2.2.4/gems/vagrant-2.2.4/lib/vagrant/util/which.rb:37: warning: Insecure world writable dir /server in PATH, mode 040777  
  3. Bringing machine 'default' up with 'parallels' provider...  
  4. ==> default: Registering VM image from the base box 'laravel/homestead'...  
  5. ==> default: Creating new virtual machine as a linked clone of the box image...  
  6. ==> default: Unregistering the box VM image...  
  7. ==> default: Setting the default configuration for VM...  
  8. ==> default: Checking if box 'laravel/homestead' version '8.0.0' is up to date...  
  9. ==> default: Setting the name of the VM: blessappyzhancom_default_1563640904299_97304  
  10. ==> default: Preparing network interfaces based on configuration...  
  11.     default: Adapter 0: shared  
  12. ==> default: Clearing any previously set network interfaces...  
  13. ==> default: Running 'pre-boot' VM customizations...  
  14. ==> default: Booting VM...  
  15. ==> default: Waiting for machine to boot. This may take a few minutes...  
  16.     default: SSH address: 10.211.55.9:22  
  17.     default: SSH username: vagrant  
  18.     default: SSH auth method: private key  
  19.     default: Warning: Connection refused. Retrying...  
  20.     default:   
  21.     default: Vagrant insecure key detected. Vagrant will automatically replace  
  22.     default: this with a newly generated keypair for better security.  
  23.     default:   
  24.     default: Inserting generated public key within guest...  
  25.     default: Removing insecure key from the guest if it's present...  
  26.     default: Key inserted! Disconnecting and reconnecting using new SSH key...  
  27. ==> default: Machine booted and ready!  
  28. ==> default: Checking for Parallels Tools installed on the VM...  
  29. ==> default: Parallels Tools installed on this VM are outdated! In most cases  
  30. ==> default: this is fine but in rare cases it can cause things such as shared  
  31. ==> default: folders to not work properly. If you see shared folder errors,  
  32. ==> default: please update Parallels Tools within the virtual machine and  
  33. ==> default: reload your VM.  
  34. ==> default: Installing the proper version of Parallels Tools. This may take a few minutes...  
  35. ==> default: Parallels Tools have been installed. Rebooting the VM...  
  36. ==> default: Attempting graceful shutdown of VM...  
  37. ==> default: Running 'pre-boot' VM customizations...  
  38. ==> default: Booting VM...  
  39. ==> default: Waiting for machine to boot. This may take a few minutes...  
  40. ==> default: Machine booted and ready!  
  41. ==> default: Mounting shared folders...  
  42.     default: /vagrant => /server/wwwroot/yzhan/test.com  

 

运行一下vagrant ssh ,顺利登录,而且看到 当前项目目录下有一个 .vagrant的目录,里面都是一些配置文件等。

到此,安装结束,看了下进程,占CPU0.x,内存400多M。ssh进去后php-fpm的进程超级多。从5.6~7.3的都有。安心的用了

 

Tags: vagrant

apache记录nginx proxy后的 真实IP

1、 nginx的proxy_pass要加载默认的 proxy_params,里面配置了怎么传递 真实IP

2、apache默认的combine的logformat默认没有取有代理 情况下的IP,所以需要加一个:
XML/HTML代码
  1. LogFormat "\"%{x-forwarded-for}i\" %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined2  
然后CustomLog的时候就是使用 combined2,例如:    CustomLog ${APACHE_LOG_DIR}/www.neatstudio.com.access.log combined2
 
上面那个logformat如果要全局使用,就放到apache.conf里。如果只是当前项目使用,则可以放到当前的hosts文件中
 
---EOF---
其实没啥,就是做个记录。老是会忘
 
 

inotify的相关文章和资料

 应该不会消失的链接:

1、https://infoq.cn/article/inotify-linux-file-system-event-monitoring

2、http://ju.outofmemory.cn/entry/264098

3、http://icodeit.org/2015/03/build-monitor-script-based-on-inotify/ ,他有提到mac用fswatch

4、http://ju.outofmemory.cn/entry/278544 有一个现成的同步脚本

其实我5年前有写过一个inotifywait + php 的脚本,主要是用来检测哪些文件被人修改了,用做防篡改。可能最近会重新用上,温故一下旧知识点

 

symlink-hook: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory

出现如标题错误的最大可能原因是。。。

你当前所在的目录被改名或者被删除了。。,尝试cd /回到根目录下再处理

Tags: linux, getcwd

补充:SSL证书完事了,但还是警告的问题

 先说为什么要处理

1、有朋友评论说,我这种frp+nginx是ssl代理方式,不能保证全站https,如果有schema检查的就有问题。
基于我大部分项目都是采用了Yii的Url::to()方法,默认不加schema。如果加了schema,他是自己读当前的URL的。所以自己开发的内容可以无视,主要还是一些第三方库。比如部分字体,部分JS。有的JS中还createElement中引用的JS。但这个毕竟少数。现在用了Vue+PHP之后。都在尽量用一些可靠的代码(不行就用unpkg之类的,卡就卡点吧)
2、水月 说,打开博客后还是有问题。。
 
所以,检查了一下,说我有几个小问题
1、支持了SSLV1,建议我不要支持。于是删除了
2、最重要的是说。。。我的证书链有问题,于是重新生成证书链,然后OK(至少到现在还是正常的)【现在网上有专门生成证书链的工具,谷哥一下就OK了】
3、额外检查了一下,真的发现有个页面里有个之前的广告链接。还是http的,改掉。(然后发现很多友情链接,都是http的。这怎么破?我先强制改成https的了。。如果打不开,我也没办法)
 
现在应该是小锁了吧?哈哈