LAMP

How to store private encrypted user data in the database, but make them available to other chosen users?

三世轮回 提交于 2019-11-30 02:24:39
firstly, I apologize if my question sounds little confusing, I will try my best to describe my scenario as detailed as possible: I have website where user can input their personal data about themselves. They are mainly health data, so it's very private and sensitive information. So I need to encrypt this data on the server even then the server is compromised these data are secured because they will be encrypted with each user's password. Of course, user passwords will not be stored as clear-type text on the server, only password hashes. But my problem is that the website will offer "social

BZOJ 2346: [Baltic 2011]Lamp Dijkstra

社会主义新天地 提交于 2019-11-30 00:57:54
Code: #include <bits/stdc++.h> #define N 600 #define M 1000000 #define inf 1000000000 #define setIO(s) freopen(s".in","r",stdin) using namespace std; char str[N]; int id[N][N],tot,edges,s; int hd[M],to[M],nex[M],val[M],done[M],d[M]; void addedge(int u,int v,int c) { nex[++edges]=hd[u],hd[u]=edges,to[edges]=v,val[edges]=c; swap(u,v); nex[++edges]=hd[u],hd[u]=edges,to[edges]=v,val[edges]=c; } struct P { int u,dis; P(int u=0,int dis=0):u(u),dis(dis){} bool operator<(P b) const { return b.dis<dis; } }; priority_queue<P>q; void Dijkstra() { for(int i=0;i<M;++i) d[i]=inf; for(d[s]=0,q.push(P(s,0));

How to enable mod_rewrite in LAMP on ubuntu? [closed]

て烟熏妆下的殇ゞ 提交于 2019-11-30 00:25:58
I'm using Ubuntu 12.04 LTS linux on my machine. I've already installed LAMP on it. Now I want to enable the mod_rewrite module. I did google a lot and tried lots of tricks but couldn't be able to enable mod_rewrite. Can anyone help me to enable the mod_rewrite? Thanks in advance. TL;DR version -- do the following in your terminal: sudo a2enmod rewrite && sudo service apache2 restart With explanations -- do the following in your terminal: ls -l /etc/apache2/mods-available/rewrite.load ///if it prints out rewrite.load, it's there and ready to go sudo a2enmod rewrite //enables the mod ls -l /etc

How to enable SOAP on CentOS

北战南征 提交于 2019-11-29 23:44:57
We have VPS with CentOS I have installed soap with following command. yum install php-soap Then I went to php.ini to un-comment soap extension. It was not there so, I added my own following line. extension=soap.so Then i restart server with following command service httpd restart But SOAP is still not enabled. as i get Fatal error: Class 'SoapClient' If i try to install it again. I get following message. Package php-soap-5.3.3-27.el6_5.x86_64 already installed and latest version I tried to re-configure PHP with following command as well. php-config '--disable-fileinfo' '--disable-pdo' '-

LAMP 环境配置

Deadly 提交于 2019-11-29 22:36:00
可以先更新一下服务器及软件 apt-get update apt-get upgrade apt-get autoclean 安装Apache:apt install apache2 Apache已开启 输入虚拟机地址,出现apache页面 安装mysql 查看是否已安装,显示未安装 安装apt install mysql-server,查看是否安装成功 登录mysql数据库可以通过如下命令: mysql -u root -p 现在是mysql数据库是没有密码的,Enter password:处直接回车,就能够进入mysql数据库 设置数据库密码:Mysql_secure_installation 安装PHP:apt install php即可 安装完成输入php -v查看版本 打开 /etc/apache2/mods-enabled/dir.conf 文件并将其更改为首先列出index.php 重启apache服务 在/var/www/html中创建一个名为index.php的新文件。 Touch intex.php 打开index.php vim /var/www/html/index.php,写入代码,保存退出 打开浏览器并输入虚拟机IP地址,访问到PHP的默认信息页面 来源: https://www.cnblogs.com/gyf12369/p/11538159.html

9.17 ubuntu安装LAMP服务

送分小仙女□ 提交于 2019-11-29 21:13:15
更新 ubuntu 源 /etc/apt/sources.list Cp /etc/apt/sources.list /etc/apt/sources.list.bak 备份 修改 vim /etc/apt/sources.list 将其中的数据修改为最新的源镜像地址 deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse deb-src http://mirrors

Ubuntu18安装LAMP环境详细步骤

血红的双手。 提交于 2019-11-29 21:00:23
Ubuntu18安装Lamp环境 1、su root 切换root账号(root账户权限高不用总输入sudo) 2、可以先更新一下服务器 apt-get update 获取最新资源包 apt-get upgrade 本机软件全部更新 apt-get dist-upgrade 本机系统软件更新 3、安装apache apt install apache2 -y 检测是否开启apache,一般会默认开启 systemctl status apache2 检测是否开启apache2 开启、关闭和重启服务器 service apache2 start service apache2 stop service apache2 restart 不能查看IP的话安装个net-tools就好了 apt install net-tools 打开浏览器输入IP地址出现这个页面就安装apache完成了 3、数据库服务器的安装 (MySQL Server 5.7或者MariaDB,选择其中一种即可) MySQL安装:apt install mysql-server mysql-client (注:安装的时候会有y/n的选项 直接全部选择y就好) 在安装的过程中,会要求你设置mysql服务器root账户的密码 开启mysql服务:service mysql start 检测是否安装成功:netstat

Linux Shell Day25

断了今生、忘了曾经 提交于 2019-11-29 20:01:34
67.监控CPU使用率 68.打印子进程 69.给lamp环境增加项目 70.简易计算器 71.判断文件并计算单词 72.打印正方形 监控CPU使用率 题目要求 用shell写一个监控服务器cpu使用率的监控脚本。 核心要点 思路:用top -bn1命令,取当前空闲cpu百分比值(只取整数部分),然后用100取减这个数值 代码 #!/bin/bash #这个脚本用来计算CPU使用率 mail_user=xxx@xxx.com m_mail() { log=$1 t_s=\`date +%s\` t_s2=\`date -d "1 hours ago" +%s\` if \[ ! -f /tmp/$log \] then #创建$log文件 touch /tmp/$log #增加a权限,只允许追加内容,不允许更改或删除 chattr +a /tmp/$log #第一次告警,可以直接写入1小时以前的时间戳 echo $t_s2 >> /tmp/$log fi #无论$log文件是否是刚刚创建,都需要查看最后一行的时间戳 t_s2=\`tail -1 /tmp/$log|awk '{print $1}'\` #取出最后一行即上次告警的时间戳后,立即写入当前的时间戳 echo $t_s>>/tmp/$log #取两次时间戳差值 v=$\[$t\_s-$t\_s2\] #如果差值超过1800

0509第十八次课:LAMP 2

浪子不回头ぞ 提交于 2019-11-29 19:55:06
LAMP 2 一、Apache虚拟主机 windows的hosts文件 hosts文件路径 添加一个域名 47.106.84.56 www.wxy.com www.test.com 测试访问 开启Apache默认虚拟主机 开启默认虚拟主机需要修改apache配置文件 vim /usr/local/apache2.4/conf/httpd.conf 去掉Include conf/extra/httpd-vhosts.conf 注释#号 修改虚拟主机文件 vim /usr/local/apache2.4/conf/extra/httpd-vhosts.conf 修改内容: <VirtualHost *:80> DocumentRoot "/data/wwwroot/abc.com" ServerNameabc.com ServerAlias www.abc.com www.123.com ErrorLog "logs/abc.com-error_log" CustomLog "logs/abc.com-access_log" common </VirtualHost> <VirtualHost *:80> DocumentRoot "/data/wwwroot/111.com" ServerName 111.com ServerAlias www.example.com

LAMP搭建

青春壹個敷衍的年華 提交于 2019-11-29 18:56:51
1、安装apache 首先关闭防火墙 [root@nmserver-7 ~]# yum install httpd [root@nmserver-7 ~]# systemctl start httpd [root@nmserver-7 ~]# systemctl enable httpd 2、安装mysql [root@nmserver-7 ~]# yum install mariadb mariadb-server mariadb-libs mariadb-devel [root@nmserver-7 ~]# systemctl start mariadb [root@nmserver-7 ~]# systemctl enable mariadb [root@nmserver-7 ~]# mysql_secure_installation 登录测试 3、安装PHP [root@nmserver-7 ~]# yum -y install php 将php与mysql关联起来 [root@nmserver-7 ~]# yum install php-mysql 安装常用PHP模块 [root@nmserver-7 ~]# yum install -y php-gd php-ldap php-odbc php-pear php-xml php-xmlrpc php-mbstring