{"id":7729,"date":"2018-01-24T02:00:39","date_gmt":"2018-01-24T02:00:39","guid":{"rendered":"https:\/\/stevepedwards.today\/DebianAdmin\/?p=7695"},"modified":"2023-10-28T20:04:33","modified_gmt":"2023-10-28T19:04:33","slug":"search-replace-on-cmd-line-2","status":"publish","type":"post","link":"https:\/\/stevepedwards.today\/DebianAdmin\/search-replace-on-cmd-line-2\/","title":{"rendered":"WP Info\/Search Replace on CMD Line\/vsftpd"},"content":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_7729\" class=\"pvc_stats all  \" data-element-id=\"7729\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>A fresh Mint install for WP to run, not just read the wp-*php files will require:<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install mysql-server wordpress apache2 libapache2-mod-php php-mbstring vsftpd php-curl php php-mysql<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo vi \/etc\/apache2\/apache2.conf <\/span><\/p>\n<p><span style=\"color: #ff0000;\"># Sets the default security model of the Apache2 HTTPD server. It does<\/span><br \/>\n<span style=\"color: #ff0000;\"># not allow access to the root filesystem outside of \/usr\/share and \/var\/www.<\/span><\/p>\n<p><span style=\"color: #ff0000;\">&lt;Directory \/var\/www&gt;<\/span><br \/>\n<span style=\"color: #ff0000;\"> Options FollowSymLinks<\/span><br \/>\n<strong><span style=\"color: #ff0000;\"> AllowOverride All <\/span>{allows permalink names change}<\/strong><br \/>\n<span style=\"color: #ff0000;\"> Require all denied<\/span><br \/>\n<span style=\"color: #ff0000;\">&lt;\/Directory&gt;<\/span><\/p>\n<p>stevee@QuadMint <span style=\"color: #0000ff;\">\/1500\/Downloads\/Search-Replace-DB-master $ .\/srdb.cli.php -h localhost -n DebianAdmin -u root -p poop -s localhost -r localhost<\/span><\/p>\n<p><span style=\"color: #0000ff;\">https:\/\/stevepedwards.today\/Search-Replace-DB-master\/<\/span><\/p>\n<p>stevee@QuadMint ~ $ <span style=\"color: #0000ff;\">sudo vi \/etc\/apache2\/sites-enabled\/000-default.conf<\/span><\/p>\n<p><span style=\"color: #ff0000;\">Alias \"\/DebianAdmin\" \"\/var\/www\/DebianAdmin\"<\/span><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-7702\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/uploads\/2018\/01\/alias-300x250.png\" alt=\"\" width=\"859\" height=\"716\" \/><\/p>\n<p><span style=\"color: #0000ff;\">sudo service apache2 restart<\/span><\/p>\n<p><strong>Export DB<\/strong><\/p>\n<p>stevee@QuadMint ~ $ <span style=\"color: #0000ff;\">mysqldump -u root -p DebianAdmin &gt; \/var\/www\/localhostDA.sql<\/span><\/p>\n<p># When \"listen\" directive is enabled, vsftpd runs in standalone mode and<br \/>\n# listens on IPv4 sockets. This directive cannot be used in conjunction<br \/>\n# with the listen_ipv6 directive.<br \/>\nlisten=YES<br \/>\n#<br \/>\n# This directive enables listening on IPv6 sockets. To listen on IPv4 and IPv6<br \/>\n# sockets, you must run two copies of vsftpd with two configuration files.<br \/>\n# Make sure, that one of the listen options is commented !!<br \/>\n#listen_ipv6=YES<\/p>\n<p><span style=\"color: #0000ff;\">sudo vi \/etc\/vsftpd.conf<\/span><\/p>\n<p># Uncomment this to allow local users to log in.<br \/>\n<span style=\"color: #ff0000;\">local_enable=YES<\/span><\/p>\n<p># Uncomment this to enable any form of FTP write command.<br \/>\n<span style=\"color: #ff0000;\">write_enable=YES<\/span><\/p>\n<p># Uncomment this to indicate that vsftpd use a utf8 filesystem.<br \/>\n<span style=\"color: #ff0000;\">utf8_filesystem=YES<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo service vsftpd restart<\/span><\/p>\n<p>To replace correct perms from 777 install:<\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/var\/www\/ -type d -exec chmod 770 -R {} ;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo find \/var\/www\/ -type f -exec chmod 644 {} ;<\/span><\/p>\n<p><span style=\"color: #0000ff;\">.\/srdb.cli.php -h localhost -n DebianAdmin -u root -p poop -s localhost -r amda8<\/span><\/p>\n<p>for;\u00a0Call to undefined function mb_regex_encoding()<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install php-mbstring<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install vsftpd<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo vi \/etc\/vsftpd.conf<\/span><\/p>\n<p>listen=YES<br \/>\n#<br \/>\n# This directive enables listening on IPv6 sockets. By default, listening<br \/>\n# on the IPv6 \"any\" address (::) will accept connections from both IPv6<br \/>\n# and IPv4 clients. It is not necessary to listen on *both* IPv4 and IPv6<br \/>\n# sockets. If you want that (perhaps because you want to listen on specific<br \/>\n# addresses) then you must run two copies of vsftpd with two configuration<br \/>\n# files.<br \/>\n#listen_ipv6=YES<\/p>\n<p># Uncomment this to indicate that vsftpd use a utf8 filesystem.<br \/>\nutf8_filesystem=YES<\/p>\n<p><span style=\"color: #0000ff;\">sudo service vsftpd restart<\/span><\/p>\n<p>stevee@localhost ~ $ <span style=\"color: #0000ff;\">nmap 192.168.1.11<\/span><\/p>\n<p>Starting Nmap 7.01 ( https:\/\/nmap.org ) at 2018-01-31 01:47 GMT<br \/>\nNmap scan report for 192.168.1.11<br \/>\nHost is up (0.00015s latency).<br \/>\nNot shown: 995 closed ports<br \/>\nPORT STATE SERVICE<br \/>\n21\/tcp open ftp<\/p>\n<p>Conf router for ports 21 NAT to PC IP addr:<\/p>\n<table width=\"700px\" cellspacing=\"0\" cellpadding=\"2\" align=\"left\">\n<tbody>\n<tr>\n<td><b>Index No.\u00a08<\/b><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" align=\"left\">\n<tbody>\n<tr>\n<td>\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"2\" align=\"left\">\n<tbody>\n<tr>\n<td><input name=\"sPSrvEnable\" type=\"checkbox\" value=\"1\" \/>\u00a0Enable<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table border=\"0\" width=\"80%\" cellspacing=\"0\" cellpadding=\"2\" align=\"left\">\n<tbody>\n<tr>\n<td width=\"50%\">Mode<\/td>\n<td width=\"50%\"><select name=\"sPSrvMode\" onchange=\"onChgMode()\"><option value=\"0\">Single<\/option><option value=\"1\">Range<\/option><\/select><\/td>\n<\/tr>\n<tr>\n<td>Service Name<\/td>\n<td><input maxlength=\"23\" name=\"sPSrvSvcName\" type=\"text\" value=\"ftp\" \/><\/td>\n<\/tr>\n<tr>\n<td>Protocol<\/td>\n<td><select name=\"sPSrvProto\"><option value=\"0\">---<\/option><option value=\"6\">TCP<\/option><option value=\"17\">UDP<\/option><\/select><\/td>\n<\/tr>\n<tr class=\"wanip\">\n<td>WAN IP<\/td>\n<td><select name=\"sPSrvWANIP\"><option value=\"-2\">All<\/option><option value=\"-1\">2.WAN1 IP Alias[1]212.159.16.47<\/option><option value=\"0\">3.WAN1 IP Alias[2]0.0.0.0<\/option><option value=\"1\">4.WAN1 IP Alias[3]0.0.0.0<\/option><option value=\"2\">5.WAN1 IP Alias[4]0.0.0.0<\/option><option value=\"3\">6.WAN1 IP Alias[5]0.0.0.0<\/option><option value=\"4\">7.WAN1 IP Alias[6]0.0.0.0<\/option><option value=\"5\">8.WAN1 IP Alias[7]0.0.0.0<\/option><option value=\"6\">9.WAN1 IP Alias[8]0.0.0.0<\/option><option value=\"7\">10.WAN2 IP Alias[1]---<\/option><option value=\"8\">11.WAN2 IP Alias[2]0.0.0.0<\/option><option value=\"9\">12.WAN2 IP Alias[3]0.0.0.0<\/option><option value=\"10\">13.WAN2 IP Alias[4]0.0.0.0<\/option><option value=\"11\">14.WAN2 IP Alias[5]0.0.0.0<\/option><option value=\"12\">15.WAN2 IP Alias[6]0.0.0.0<\/option><option value=\"13\">16.WAN2 IP Alias[7]0.0.0.0<\/option><option value=\"14\">17.WAN2 IP Alias[8]0.0.0.0<\/option><option value=\"15\">18.WAN3 IP ---<\/option><\/select><\/td>\n<\/tr>\n<tr>\n<td>Public Port<\/td>\n<td><input maxlength=\"5\" name=\"sPSrvPubPort\" size=\"5\" type=\"text\" value=\"21\" \/><\/td>\n<\/tr>\n<tr>\n<td>Private IP<\/td>\n<td><input maxlength=\"15\" name=\"sPSrvPrvIp\" size=\"15\" type=\"text\" value=\"192.168.1.12\" \/><\/td>\n<\/tr>\n<tr>\n<td>Private Port<\/td>\n<td><input maxlength=\"5\" name=\"sPSrvPrvPort\" size=\"5\" type=\"text\" value=\"21\" \/><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>For Optimus:<\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install php-curl<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo service apache2 restart<\/span><\/p>\n<p>Is php installed??<\/p>\n<p>stevee@QuadMint ~ $<span style=\"color: #0000ff;\"> which php<\/span><br \/>\n<span style=\"color: #ff0000;\">\/usr\/bin\/php<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo apt install php\u00a0php-mysql<\/span><\/p>\n<p>Importing Posts:<\/p>\n<p><span style=\"color: #0000ff;\">sudo vi \/etc\/php\/7.0\/apache2\/php.ini<\/span><\/p>\n<p>; Maximum size of POST data that PHP will accept.<br \/>\n; Its value may be 0 to disable the limit. It is ignored if POST data reading<br \/>\n; is disabled through enable_post_data_reading.<br \/>\n; https:\/\/php.net\/post-max-size<br \/>\n<span style=\"color: #ff0000;\">post_max_size = 0<\/span><\/p>\n<p>; Maximum allowed size for uploaded files.<br \/>\n; https:\/\/php.net\/upload-max-filesize<br \/>\n<span style=\"color: #ff0000;\">upload_max_filesize = 20M<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo service apache2 restart<\/span><\/p>\n<p>for Permalink postname failure:<\/p>\n<p>stevee@localhost ~ $ <span style=\"color: #0000ff;\">sudo vi \/var\/www\/DebianAdmin\/.htaccess<\/span><\/p>\n<p><span style=\"color: #ff0000;\"># BEGIN WordPress<\/span><br \/>\n<span style=\"color: #ff0000;\"> &lt;IfModule mod_rewrite.c&gt;<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteEngine On<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteBase \/DebianAdmin\/<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteRule ^index.php$ - [L]<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteCond %{REQUEST_FILENAME} !-f<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteCond %{REQUEST_FILENAME} !-d<\/span><br \/>\n<span style=\"color: #ff0000;\"> RewriteRule . \/DebianAdmin\/index.php [L]<\/span><br \/>\n<span style=\"color: #ff0000;\"> &lt;\/IfModule&gt;<\/span><\/p>\n<p><span style=\"color: #ff0000;\"># END WordPress<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo a2enmod rewrite<\/span><\/p>\n<p><span style=\"color: #0000ff;\">sudo service apache2 restart<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_7729\" class=\"pvc_stats all  \" data-element-id=\"7729\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/stevepedwards.today\/DebianAdmin\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n<p>A fresh Mint install for WP to run, not just read the wp-*php files will require: sudo apt install mysql-server wordpress apache2 libapache2-mod-php php-mbstring vsftpd php-curl php php-mysql sudo vi \/etc\/apache2\/apache2.conf # Sets the default security model of the Apache2 HTTPD server. It does # not allow access to the root filesystem outside of \/usr\/share <a href=\"https:\/\/stevepedwards.today\/DebianAdmin\/search-replace-on-cmd-line-2\/\" class=\"more-link\">...<span class=\"screen-reader-text\">\u00a0 WP Info\/Search Replace on CMD Line\/vsftpd<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7729","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"a3_pvc":{"activated":true,"total_views":1,"today_views":0},"_links":{"self":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/7729","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/comments?post=7729"}],"version-history":[{"count":16,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/7729\/revisions"}],"predecessor-version":[{"id":9879,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/posts\/7729\/revisions\/9879"}],"wp:attachment":[{"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/media?parent=7729"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/categories?post=7729"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/stevepedwards.today\/DebianAdmin\/wp-json\/wp\/v2\/tags?post=7729"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}