LNMP安装脚本,解决方案中各文件夹存放了些什么

“请求被中止: 未能创建 SSL/TLS 安全通道”解决办法,ssltls

1.安装证书:

手动双击证书安装,过程略

2.分配权限:

在控制台中找到安装的证书,右键选择“管理私钥”,

图片 1

 

图片 2

添加自己需要的权限,如果在测试可以直接添加Everyone

3.修改代码:public static string Refund(string urlWithParams)

{
    ServicePointManager.Expect100Continue = true;
    ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls;   //协议按需选择,不行就都试一遍
    ServicePointManager.ServerCertificateValidationCallback = (object sender, X509Certificate certificate, X509Chain chain, SslPolicyErrors sslPolicyErrors) => { return true; };

    HttpWebRequest webRequest = (HttpWebRequest)HttpWebRequest.Create(urlWithParams);
    webRequest.Method = "GET";

    //查找我们导入的证书
    X509Store certStore = new X509Store(StoreName.My, StoreLocation.LocalMachine);
    certStore.Open(OpenFlags.ReadOnly);
    X509Certificate2Collection certCollection = certStore.Certificates.Find(X509FindType.FindBySubjectName, "安装的证书名字", false);
    webRequest.ClientCertificates.Add(certCollection[0]);

    using (WebResponse webResponse = webRequest.GetResponse())
    {
        var sr = new StreamReader(webResponse.GetResponseStream(), Encoding.UTF8);
        var responseData = sr.ReadToEnd();
        return responseData;
    }
}

 

: 未能创建 SSL/TLS
安全通道解决办法,ssltls 1.安装证书: 手动双击证书安装,过程略
2.分配权限: 在控制台中找到安装的证书,…

去公司boss叫写个LNMP自动安装的脚本折腾了三天写完 体积有点臃肿
但是能自动安装的。现在就把三个脚本贡献给博友们。。。

一个C#解决方案中各文件夹存放了些什么,

在VS2015中“生成”(Build)的过程:

Source Code(.cs) —> Compile —> Object File(intermediate files)
—> Linker —> Debug Version(.exe) 和 Release Version(.exe)

 

Obj文件夹: 

The obj folder holds object, or intermediate, files, which are
compiled binary files that haven’t been linked yet. They’re essentially
fragments that will be combined to produce the final executable. The
compiler generates one object file for each source file, and those files
are placed into the obj folder.

 

Bin文件夹:

The bin folder holds binary files, which are the actual executable
code for your application or library.

 

所以,Obj文件夹中放了编译后的中间语言文件;而Bin文件夹中放了可执行文件(.exe),Bin中有两个版本debug和release,release中是优化后的.exe文件,debug是调试中的.exe文件。

 

.cs 类文件,源代码都写在这里,主要就看这里的代码。

 

.resx 资源文件,一些资源存放在这里,一般不需要看。

 

.csproj
C#项目文件,用VS打开这个文件就可以直接打开这个项目,自动生成,不需要看。

.csproj.user
是一个配置文件,自动生成的,会记录项目生成路径、项目启动程序等信息。也不需要看。

.Designer.cs 设计文件,自动生成,不需要看。

.aspx 是网页文件,HTML代码写在这里面。

sln:在开发环境中使用的解决方案文件。它将一个或多个项目的所有元素组织到单个的解决方案中。此文件存储在父项目目录中.解决方案文件,他是一个或多个.proj(项目)的集合

 

 

在VS2015中“生成”(Build)的过程: Source Code(.cs) — Compile — Object
File(intermediate files) — Linker…

安装脚本分为3段sql.sh   php.sh  和 nginx.sh

安装过程也请按照这个顺序安装就行

SQL.SH

#!/bin/bash  SOFT=/data2/software  B=/dev/null SQL=/usr/local/webserver/mysql  SQLDIR=/data0/mysql/3306  PATHROOT=/usr/local/webserver  ! [ -e $SQLDIR ] && mkdir -p $SQLDIR/{data,binlog,relaylog}  ! [ -e $PATHROOT ] && mkdir -p $PATHROOT   echo "downloading msyql-5.5...please wait a moment..." cd $SOFT  wget http://mirror.trouble-free.net/mysql_mirror/Downloads/MySQL-5.5/mysql-5.5.25a.tar.gz  wget http://www.cmake.org/files/v2.8/cmake-2.8.6.tar.gz  ! id mysql && groupadd -r mysql && useradd -r -g mysql -M -s /sbin/nologin mysql &> $B  tar xf cmake-2.8.6.tar.gz  yum -y install gcc gcc-c++ autoconf libjpeg libjpeg-devel libpng libpng-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glibc glibc-devel glib2 glib2-devel bzip2 bzip2-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel openldap openldap-devel nss_ldap openldap-clients openldap-servers  cd cmake-2.8.6  ./configure  make  make install  cd ..  tar xf mysql-5.5.25a.tar.gz  cd mysql-5.5.25a  cmake -DCMAKE_INSTALL_PREFIX=$SQL -DMYSQL_DATADIR=/data0/mysql/3306/data/ -DWITH_MYISAM_STORAGE_ENGINE=1 -DWITH_INNOBASE_STORAGE_ENGINE=1 -DWITH_ARCHIVE_STORAGE_ENGINE=1 -DWITH_BLACKHOLE_STORAGE_ENGINE=1 -DENABLED_LOCAL_INFILE=1 -DDEFAULT_CHARSET=utf8 -DDEFAULT_COLLATION=utf8_general_ci  -DEXTRA_CHARSETS=all -DMYSQL_TCP_PORT=3306 -DWITH_DEBUG=OFF -DWITH_READLINE=1 -DMYSQL_UNIX_ADDR=/tmp/mysql.sock  make  make install   cd $ SQL  cp support-files/my-medium.cnf /data0/mysql/3306/data/my.cnf  cp /usr/local/webserver/mysql/support-files/mysql.server /etc/rc.d/init.d/mysqldchmod +x /etc/rc.d/init.d/mysqldln -s /usr/local/mysql/lib/libmysqlclient.so.18 /usr/lib64/libmysqlclient.so.18   chown -R mysql:mysql ./* $SQLDIR  chmod +w $SQL  $SQL/scripts/mysql_install_db --basedir=$SQL --datadir=$SQLDIR/data --user=mysql  cat >>$SQLDIR/my.cnf<<EOF  [client]  character-set-server = utf8  port    = 3306  socket  = /tmp/mysql.sock   [mysqld]  character-set-server = utf8  replicate-ignore-db = mysql  replicate-ignore-db = test  replicate-ignore-db = information_schema  user    = mysql  port    = 3306  socket  = /tmp/mysql.sock  basedir = /usr/local/webserver/mysql  datadir = /data0/mysql/3306/data  log-error = /data0/mysql/3306/mysql_error.log  pid-file = /data0/mysql/3306/mysql.pid  open_files_limit    = 10240  back_log = 600  max_connections = 5000  max_connect_errors = 6000  table_cache = 614  external-locking = FALSE max_allowed_packet = 32M  sort_buffer_size = 1M  join_buffer_size = 1M  thread_cache_size = 300  #thread_concurrency = 8  query_cache_size = 512M  query_cache_limit = 2M  query_cache_min_res_unit = 2k  default-storage-engine = MyISAM  thread_stack = 192K  transaction_isolation = READ-COMMITTED tmp_table_size = 246M  max_heap_table_size = 246M  long_query_time = 3  log-slave-updates  log-bin = /data0/mysql/3306/binlog/binlog  binlog_cache_size = 4M  binlog_format = MIXED  max_binlog_cache_size = 8M  max_binlog_size = 1G  relay-log-index = /data0/mysql/3306/relaylog/relaylog  relay-log-info-file = /data0/mysql/3306/relaylog/relaylog  relay-log = /data0/mysql/3306/relaylog/relaylog  expire_logs_days = 30  key_buffer_size = 256M  read_buffer_size = 1M  read_rnd_buffer_size = 16M  bulk_insert_buffer_size = 64M  myisam_sort_buffer_size = 128M  myisam_max_sort_file_size = 10G  myisam_repair_threads = 1  myisam_recover   interactive_timeout = 120  wait_timeout = 120   skip-name-resolve  #master-connect-retry = 10  slave-skip-errors = 1032,1062,126,1114,1146,1048,1396   #master-host     =   192.168.1.2  #master-user     =   username  #master-password =   password #master-port     =  3306   server-id = 1   innodb_additional_mem_pool_size = 16M  innodb_buffer_pool_size = 512M  innodb_data_file_path = ibdata1:256M:autoextend  innodb_file_io_threads = 4  innodb_thread_concurrency = 8  innodb_flush_log_at_trx_commit = 2  innodb_log_buffer_size = 16M  innodb_log_file_size = 128M  innodb_log_files_in_group = 3  innodb_max_dirty_pages_pct = 90  innodb_lock_wait_timeout = 120  innodb_file_per_table = 0   #log-slow-queries = /data0/mysql/3306/slow.log  #long_query_time = 10   [mysqldump]  quick  max_allowed_packet = 32M  EOF    mkdir -pv /usr/local/mysql/bin  chmod +x $SQLDIR/mysql  ln -sv $SQL/bin/* /usr/local/mysql/bin &> $B  ln -sv $SQL/include /usr/include/mysql  ldconfig  service mysqld start  if netstat -tnlp|grep mysqld &> /dev/null ;then echo "mysql-5.5 install success..." fi  

PHP.SH

发表评论