鍍金池/ 問答/ Linux問答
失魂人 回答

根據(jù)查閱到的資料,我發(fā)現(xiàn)問題并沒有出在后端,而是出來前端的angular上。
在發(fā)送http請求時,需要配置一個選項:

  /* 獲取驗證碼 */
  getCaptcha(): Observable<any> {
    const url = `${Config.apiRoot}captcha`;
    const options = new RequestOptions({
      withCredentials: true
    });
    return this.http.get(url, options)
      .map(this.extraData)
      .catch(this.handleError);
  }
  

配置withCredentials: true來允許客戶端在跨域請求時允許setcookie響應(yīng)頭。

此外,服務(wù)器端需要配置中間件:

app.all('*', function(req, res, next) {
  res.header('Access-Control-Allow-Origin', 'http://localhost:4200'); // 跨域的源
  res.header('Access-Control-Allow-Headers', 'Origin, No-Cache, X-Requested-With, If-Modified-Since, Pragma, Last-Modified, Cache-Control, Expires, Content-Type, X-E4M-With, X-Access-Token, X-Real-IP');
  res.header('Access-Control-Allow-Methods','PUT,POST,GET,DELETE,OPTIONS');
  res.header('Access-Control-Allow-Credentials', 'true');
  next();
});

這樣能夠解決跨域請求時,setcookie響應(yīng)頭無效/被忽略的問題。

淚染裳 回答
server {
    listen       80;
    server_name  localhost;

    location /a {
        alias /test/nginx/a;
        index  index.html index.htm;
        try_files $uri /a/index.html;
    }

    location /b {
        alias /test/nginx/b;
        index  index.html index.htm;
        try_files $uri /b/index.html;
    }
}
瞄小懶 回答

Nginx 配置中設(shè)置代理的地方增加一行 proxy_redirect http:// $scheme://; 試試。

假設(shè)你的environment-variable.ini內(nèi)容是這樣的
UNIVER_PROJECR_PORT='79000000'
我寫了一個,能實現(xiàn),你可以看看,應(yīng)該有更好的
#!/bin/bash
while read line;do  
    eval "$line"
done < environment-variable.ini
echo $UNIVER_PROJECR_PORT

if [ $UNIVER_PROJECR_PORT == $(sed '/^UNIVER_PROJECR_PORT=/!d;s/.*=//' /etc/profile) ];then
    echo '一致'
else
    echo '不一致,需要修改成配置文件中的參數(shù)'
    sed -i '/UNIVER_PROJECR_PORT/d' /etc/profile       #刪除原有的
    echo "export UNIVER_PROJECR_PORT="$UNIVER_PROJECR_PORT>>/etc/profile  #添加新的
fi

source /etc/profile
冷眸 回答

因為這兩個location是同級的,匹配了其中一個,另外一個就不會匹配到
所以第二個是永遠(yuǎn)匹配不到的

把第二個提到前面,并且加上第一個的完整配置。

    location ~ wp-admin/\.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k; 
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 128k;
        # fastcgi cache
        fastcgi_cache_bypass $no_cache;
        fastcgi_no_cache $no_cache;
        fastcgi_cache WORDPRESS;
        fastcgi_cache_valid 200 301 302 1d;
        add_header X-Cache "$upstream_cache_status From $host";
        fastcgi_buffering off; # Making the updates in Wordpress real time.
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
        fastcgi_connect_timeout 600;
        fastcgi_send_timeout 600;
        fastcgi_read_timeout 600;
        fastcgi_buffer_size 64k;
        fastcgi_buffers 4 64k; 
        fastcgi_busy_buffers_size 128k;
        fastcgi_temp_file_write_size 128k;
        # fastcgi cache
        fastcgi_cache_bypass $no_cache;
        fastcgi_no_cache $no_cache;
        fastcgi_cache WORDPRESS;
        fastcgi_cache_valid 200 301 302 1d;
        add_header X-Cache "$upstream_cache_status From $host";
    }
鐧簞噯 回答

路徑不一樣,一個是類路徑 。在項目路徑 下創(chuàng)建lib文件夾
通常是在這里加載的。

終相守 回答

你看下你添加的遠(yuǎn)程倉庫git remote -v, 試試在https和ssh方式間切換一下

話寡 回答

你的代碼在linux上運行沒有任何問題

#include <stdio.h>  
#include <pthread.h>  

void * product(void *arg){
    int rear = 0 ;
    while(1) {
        rear = (rear + 1)%5;
        printf("p:%d\n",rear);
        sleep(1);
    } 
}

int main(void) {
    pthread_t pid;
    pthread_create(&pid,NULL,product,NULL);
    pthread_join(pid,NULL);
    return 0; 
}

編譯

gcc pthread.c -pthread

輸出

p:0
p:1
p:2
p:3
p:4
p:0
p:1
p:2
p:3
p:4
......

不知你說是內(nèi)存溢出指的是什么?什么環(huán)境條件?

拮據(jù) 回答

安裝Samba服務(wù)器
sudo apt-get install samba
配置Samba服務(wù)
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf~orig
測試配置
[global]
security = share (share參數(shù)已廢棄)
[myshare]
path = /usr/share/doc/samba
public = yes
//測試安全級別
[global]
security = user
[myshare]
path = /usr/share/doc/samba
valid user = freya
public = no
//可選參數(shù)
writeable = yes //可以寫入
valid user = @Teacher //使用組方式驗證-
配置Samba用戶
可以使用系統(tǒng)賬號來配置
創(chuàng)建系統(tǒng)用戶(配置Ubuntu用戶) ->創(chuàng)建對應(yīng)的samba用戶(sudo smbpasswd -a luoding)
可以使用虛擬samba用戶來配置
打開映射選項->創(chuàng)建對應(yīng)系統(tǒng)賬號的samba用戶
配置日志文件:
維護及常用命令
testparm -s 檢查配置文件的語法錯誤 testparm -v 檢查并列出詳細(xì)參數(shù)
重啟smb服務(wù): sudo service smbd restart
查看當(dāng)前的連接: smbstatus
查看smb用戶: sudo pdbedit -L
日志位置:/var/log/samba/log.%m

夏木 回答

檢查下gitlab下的日志tail -100 /var/log/gitlab/gitlab-rails/production.log

放開她 回答

:file-list="fileList3"
這里 綁定的fileList3 數(shù)組 清空下,內(nèi)容也就沒有了吧。

陌離殤 回答

服務(wù)器缺mysql extension。VPS的話請百度,共享主機請去找主機商。


msql.so是微軟M$ SQL server的,不是mysql的。它倆完全不一樣。

真難過 回答

修改第三方模塊的源碼,主要問題是要考慮項目再次部署的問題,因為 npm store 里沒有你的修改。
一種做法是 fork 原始的的 git repo,代碼修改好后,

  1. 在開發(fā)階段,為了避免每次修改后都要重新安裝該模塊,一般推薦使用 npm link (具體參閱 npm 文檔)
  2. 開發(fā)完成后,首先確認(rèn)自己 github 中那份 repo 包含了必須的修改,然后從repo 位置安裝該模塊

    npm install <your_github_name>/bootstrap-vue --save

    (npm 從 git repo 安裝模塊,可以指定分支或 commit id,具體參閱 npm 文檔)

這之后,再次部署項目時的問題就消除了。


如僅僅是修改樣式,應(yīng)該是沒有必要走上述那條彎路,在自己的樣式文件里可以進行覆蓋吧

尐懶貓 回答

為了程序的簡單易用性。每個配置都有默認(rèn)值吧 ?

失魂人 回答

不用進行任何特殊設(shè)置,安裝好 apache 就可以訪問

哎呦喂 回答

1.首先,你可以直接在服務(wù)器上用babel-node啟動app.js試試看。如果能起來說明是forever的問題
2.如果不能起來,是不是你的babel-node的版本不對

真難過 回答

ctrl+c試一下,可能沒卡過來